From 9b0c18632b2bebc4d0b2f666855e2c127f06ba4a Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Sat, 8 Aug 2015 21:51:36 -0700 Subject: [PATCH 001/109] Added test script for multiple file webseed. --- .../Leaves of Grass by Walt Whitman.epub | Bin 0 -> 362017 bytes test/content/multiple/blocklist.txt | 2 + test/content/multiple/blocklist.txt.gz | Bin 0 -> 91 bytes test/content/multiple/folder/file.txt | 1 + test/content/multiple/numbers/1.txt | 1 + test/content/multiple/numbers/2.txt | 1 + test/content/multiple/numbers/3.txt | 1 + ...download-webseed-multiple-files-torrent.js | 67 ++++++++++++++++++ test/torrents/multiple.torrent | Bin 0 -> 678 bytes 9 files changed, 73 insertions(+) create mode 100644 test/content/multiple/Leaves of Grass by Walt Whitman.epub create mode 100644 test/content/multiple/blocklist.txt create mode 100644 test/content/multiple/blocklist.txt.gz create mode 100644 test/content/multiple/folder/file.txt create mode 100644 test/content/multiple/numbers/1.txt create mode 100644 test/content/multiple/numbers/2.txt create mode 100644 test/content/multiple/numbers/3.txt create mode 100644 test/download-webseed-multiple-files-torrent.js create mode 100644 test/torrents/multiple.torrent diff --git a/test/content/multiple/Leaves of Grass by Walt Whitman.epub b/test/content/multiple/Leaves of Grass by Walt Whitman.epub new file mode 100644 index 0000000000000000000000000000000000000000..66791ed3b0d9aaf29fc687d803c43a74c1372e8c GIT binary patch literal 362017 zcmb@sV{oQT)GZuqV%xTp2_|=Jb7I@J?MyteZQHh;+_7z+c}|^ks^0JS*VU`Lx~|&Y z)oWdQ*RI;FAPo+I4)R|^R<;qcGpL~dZ}lHw{=vq=#>Cmf-o(J(-rB;*z}dpimdV84 z#gNX^!d~J3Si<~o%SI^};);J3@Be`L53-^vf((*!VoXMMw$26?wkD2@?l#u4(|w3R z#PCqS4tc>=dyS+i9Zb?UdiW@^ffN|VjSVDz>^PgR9=(oTUg)O)3J)O$+bLCMfONr# zWE4lo8%b#Q8NC4~p@9KKoaDWWpeW^Q;p}9*N^>MBP{K6}v|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Fs}YUj&2>N;*2+|KSCo{A=0{!hL_(eaW6LZjL&+!};^Iau~UkTZ5}jo|nq z>AtatD`t1?t3JQ}5;L6=^W9>Z#9KfX=?$z(#l#}VCI<#MFw9jgC9L&}*#G(V&kO&b zlm9-leg64iX=({~aJ7N|uN3~jq$=g{?-v2TUjQ$FFaGDq_7Mg?zmk6QfJvhx8roNwD?_zABGb(H6{iI0Tu=Zun*q<9N9iJz}bJTkF_y@+c+9<8rs|cE?n@< zAL<7r)55{PAp9Ru42*0a9YEc`gt`B3a(VQby2?O$U*Pqhas+^;f64Lu-{hW`AKj2J zU|`7YVPMGq2cGYL%RL9OYGG>l-08iwy~A^p=O&H-bsE6!OrF1Yu(Wt?Y-$0wfBp}` zzuq|B|N9@u|3+~Ay^x^=`&DhC7#MtCeg{2f{C8&mUqN~PCv5ERpiRdggLGXnFr>sW ze=8}i{$GOf{tWKHddv7P zL52PZdWb9i>?J@BdjJo={0~Or%=t@DoYrI@YJa*m0;plF!rxKp%KsMi z&$QI4poqi)2J8F!-%-hS{}%PnyhJ?k!-wfP21XmeOaIx2J^66{vR(g7O!qfV8Et?X z2Iv2ditq5ZsDEarwbn0EuYs%0Qu^m?|-*ket*R3e^Ggr{*C(Y2d;jX{N4BcU&#@te@p%!p0JX_ VE!=-n&;fsvw*jNY?H2Iu{{ue{TY>-p literal 0 HcmV?d00001 diff --git a/test/content/multiple/blocklist.txt b/test/content/multiple/blocklist.txt new file mode 100644 index 00000000..167627df --- /dev/null +++ b/test/content/multiple/blocklist.txt @@ -0,0 +1,2 @@ +Blah blah description:1.2.3.0-1.2.3.255 +Blah blah different description:5.6.7.0-5.6.7.255 diff --git a/test/content/multiple/blocklist.txt.gz b/test/content/multiple/blocklist.txt.gz new file mode 100644 index 0000000000000000000000000000000000000000..5f401edcb60c1039af5f02660f0cbc2a0acc0b92 GIT binary patch literal 91 zcmV-h0HpsPiwFpSi>Oop17d7%V{2?_b963rcys`B%1O*nNCFWlsl~}fnFS@8`FU1` xdPaK2dIq`>+Q`(D%L$<_Gc7H(C^fGHMTe=LnVvaN2ZRRc007YA@kLqy003;~BtHNE literal 0 HcmV?d00001 diff --git a/test/content/multiple/folder/file.txt b/test/content/multiple/folder/file.txt new file mode 100644 index 00000000..0637880d --- /dev/null +++ b/test/content/multiple/folder/file.txt @@ -0,0 +1 @@ +This is a file diff --git a/test/content/multiple/numbers/1.txt b/test/content/multiple/numbers/1.txt new file mode 100644 index 00000000..56a6051c --- /dev/null +++ b/test/content/multiple/numbers/1.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/test/content/multiple/numbers/2.txt b/test/content/multiple/numbers/2.txt new file mode 100644 index 00000000..8fdd954d --- /dev/null +++ b/test/content/multiple/numbers/2.txt @@ -0,0 +1 @@ +22 \ No newline at end of file diff --git a/test/content/multiple/numbers/3.txt b/test/content/multiple/numbers/3.txt new file mode 100644 index 00000000..4f376707 --- /dev/null +++ b/test/content/multiple/numbers/3.txt @@ -0,0 +1 @@ +333 \ No newline at end of file diff --git a/test/download-webseed-multiple-files-torrent.js b/test/download-webseed-multiple-files-torrent.js new file mode 100644 index 00000000..aeb499a6 --- /dev/null +++ b/test/download-webseed-multiple-files-torrent.js @@ -0,0 +1,67 @@ +var auto = require('run-auto') +var fs = require('fs') +var parseTorrent = require('parse-torrent') +var test = require('tape') +var WebTorrent = require('../') + +var http = require('http') +var serveStatic = require('serve-static') +var finalhandler = require('finalhandler') +var path = require('path') +var multipleFileTorrent = fs.readFileSync(__dirname + '/torrents/multiple.torrent') +var multipleFileTorrentParsed = parseTorrent(multipleFileTorrent) + +// remove trackers from .torrent file +multipleFileTorrentParsed.announce = [] + +test('Download multiple files using webseed (via .torrent file)', function (t) { + t.plan(18) + + var serve = serveStatic(path.join(__dirname, 'content')) + var httpServer = http.createServer(function (req, res) { + var done = finalhandler(req, res) + serve(req, res, done) + }) + + httpServer.on('error', function (err) { t.fail(err) }) + + auto({ + httpPort: function (cb) { + httpServer.listen(cb) + }, + client: ['httpPort', function (cb) { + multipleFileTorrentParsed.urlList.push( + 'http://localhost:' + httpServer.address().port + '/' + ) + + var client = new WebTorrent({ tracker: false, dht: false }) + + client.on('error', function (err) { t.fail(err) }) + client.on('warning', function (err) { t.fail(err) }) + + client.on('torrent', function (torrent) { + torrent.files.forEach(function (file) { + file.getBuffer(function (err, buf) { + t.error(err) + t.deepEqual(buf, fs.readFileSync(__dirname + '/content/' + file.path), 'downloaded correct content') + }) + }) + + torrent.once('done', function () { + t.pass('client downloaded torrent from webseed') + cb(null, client) + }) + }) + + client.add(multipleFileTorrentParsed) + }] + }, function (err, r) { + t.error(err) + r.client.destroy(function () { + t.pass('client destroyed') + }) + httpServer.close(function () { + t.pass('http server closed') + }) + }) +}) diff --git a/test/torrents/multiple.torrent b/test/torrents/multiple.torrent new file mode 100644 index 0000000000000000000000000000000000000000..e73e40d3e0adcf63836b266704eb07c34dc84e2b GIT binary patch literal 678 zcmYc>G_Xo8N=+ zs!A`t3R$6{DNLc6RT|i57GO7{8wfYg+$yg$Hz~EK*wo4pU6B#YEF?un=!%T7C^Cj9 z0?Oni=B8R$<(B4@WESM48X8#@WTqykD!@X|$lS~#)eIt7Y-D0!)tjI0F-Ip(bJOKX zNeod5uPdiFR6g|U>xvZmd%-YPFeJitr~0Jrk1HlH`aHgV>*K4I7P-6?<^2~9{`b6* z=~Lq^ZSyQEQDohXj}!iEaj9!rc&uBZb=G^s)|0~W3Y>3}{X#` Date: Sun, 9 Aug 2015 08:56:49 -0700 Subject: [PATCH 002/109] fixed test script for multiple files torrent. --- test/download-webseed-multiple-files-torrent.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/download-webseed-multiple-files-torrent.js b/test/download-webseed-multiple-files-torrent.js index aeb499a6..9e945789 100644 --- a/test/download-webseed-multiple-files-torrent.js +++ b/test/download-webseed-multiple-files-torrent.js @@ -15,7 +15,7 @@ var multipleFileTorrentParsed = parseTorrent(multipleFileTorrent) multipleFileTorrentParsed.announce = [] test('Download multiple files using webseed (via .torrent file)', function (t) { - t.plan(18) + t.plan(19) var serve = serveStatic(path.join(__dirname, 'content')) var httpServer = http.createServer(function (req, res) { @@ -39,17 +39,21 @@ test('Download multiple files using webseed (via .torrent file)', function (t) { client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) + var count = 0 client.on('torrent', function (torrent) { torrent.files.forEach(function (file) { file.getBuffer(function (err, buf) { t.error(err) t.deepEqual(buf, fs.readFileSync(__dirname + '/content/' + file.path), 'downloaded correct content') + if (++count === 7) { + t.pass('7 files downloaded from webseed') + cb(null, client) + } }) }) torrent.once('done', function () { t.pass('client downloaded torrent from webseed') - cb(null, client) }) }) From ecf8eb7ac3ab80d78d651418bd086d6ac6dfd7e8 Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Sun, 9 Aug 2015 08:57:23 -0700 Subject: [PATCH 003/109] added webseed multiple files for magnet. --- .../download-webseed-multiple-files-magnet.js | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 test/download-webseed-multiple-files-magnet.js diff --git a/test/download-webseed-multiple-files-magnet.js b/test/download-webseed-multiple-files-magnet.js new file mode 100644 index 00000000..0fcb1e58 --- /dev/null +++ b/test/download-webseed-multiple-files-magnet.js @@ -0,0 +1,121 @@ +var auto = require('run-auto') +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') +var parseTorrent = require('parse-torrent') +var path = require('path') +var serveStatic = require('serve-static') +var test = require('tape') +var WebTorrent = require('../') + +var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesFilename = 'Leaves of Grass by Walt Whitman.epub' +var leavesFile = fs.readFileSync(leavesPath) + +var multipleFileTorrent = fs.readFileSync(__dirname + '/torrents/multiple.torrent') +var multipleFileTorrentParsed = parseTorrent(multipleFileTorrent) + +// remove trackers from .torrent file +multipleFileTorrentParsed.announce = [] +test('Download using multiple files webseed (via magnet uri)', function (t) { + t.plan(22) + + var serve = serveStatic(path.join(__dirname, 'content')) + var httpServer = http.createServer(function (req, res) { + var done = finalhandler(req, res) + serve(req, res, done) + }) + var magnetUri + + httpServer.on('error', function (err) { t.fail(err) }) + + auto({ + httpPort: function (cb) { + httpServer.listen(cb) + }, + client1: ['httpPort', function (cb) { + var client1 = new WebTorrent({ tracker: false, dht: false }) + client1.on('error', function (err) { t.fail(err) }) + client1.on('warning', function (err) { t.fail(err) }) + + client1.add(multipleFileTorrentParsed) + + var gotTorrent = false + var gotListening = false + function maybeDone () { + if (gotTorrent && gotListening) cb(null, client1) + } + + client1.on('torrent', function (torrent) { + // torrent metadata has been fetched -- sanity check it + t.equal(torrent.name, 'multiple') + + var names = [ + 'Leaves of Grass by Walt Whitman.epub', + 'blocklist.txt', + 'blocklist.txt.gz', + 'file.txt', + '1.txt', + '2.txt', + '3.txt' + ] + + t.deepEqual(torrent.files.map(function (file) { return file.name }), names) + + // NOTE: client1 is *NOT* a seeder. Just has the metadata. + gotTorrent = true + maybeDone() + }) + + client1.on('listening', function () { + gotListening = true + maybeDone() + }) + }], + client2: ['client1', 'httpPort', function (cb, r) { + var webSeedUrl = 'http://localhost:' + httpServer.address().port + '/' + magnetUri = 'magnet:?xt=urn:btih:' + multipleFileTorrentParsed.infoHash + + '&ws=' + encodeURIComponent(webSeedUrl) + + var client2 = new WebTorrent({ tracker: false, dht: false }) + + client2.on('error', function (err) { t.fail(err) }) + client2.on('warning', function (err) { t.fail(err) }) + + client2.on('torrent', function (torrent) { + var count = 0 + torrent.files.forEach(function (file) { + file.getBuffer(function (err, buf) { + t.error(err) + t.deepEqual(buf, fs.readFileSync(__dirname + '/content/' + file.path), 'downloaded correct content') + if (++count === 7) { + t.pass('7 files downloaded from webseed') + cb(null, client2) + } + }) + }) + + torrent.once('done', function () { + t.pass('client2 downloaded torrent from client1') + }) + }) + + client2.add(magnetUri) + + client2.on('listening', function (port, torrent) { + torrent.addPeer('127.0.0.1:' + r.client1.torrentPort) + }) + }] + }, function (err, r) { + t.error(err) + r.client1.destroy(function () { + t.pass('client destroyed') + }) + r.client2.destroy(function () { + t.pass('client destroyed') + }) + httpServer.close(function () { + t.pass('http server closed') + }) + }) +}) From 041b1c95b1b6e657ddd99fde92c36e66e765de90 Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Sun, 9 Aug 2015 09:00:15 -0700 Subject: [PATCH 004/109] style --- test/download-webseed-multiple-files-magnet.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/download-webseed-multiple-files-magnet.js b/test/download-webseed-multiple-files-magnet.js index 0fcb1e58..ef37c2d7 100644 --- a/test/download-webseed-multiple-files-magnet.js +++ b/test/download-webseed-multiple-files-magnet.js @@ -8,10 +8,6 @@ var serveStatic = require('serve-static') var test = require('tape') var WebTorrent = require('../') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' -var leavesFilename = 'Leaves of Grass by Walt Whitman.epub' -var leavesFile = fs.readFileSync(leavesPath) - var multipleFileTorrent = fs.readFileSync(__dirname + '/torrents/multiple.torrent') var multipleFileTorrentParsed = parseTorrent(multipleFileTorrent) From 1c740c30572ccce43501a48870d30078e72d907d Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Mon, 26 Oct 2015 17:36:36 -0700 Subject: [PATCH 005/109] Switch to work repo to test multiple file download in webseed. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a7e33ae0..5674c26a 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "addr-to-ip-port": "^1.0.1", "bitfield": "^1.0.2", "bittorrent-dht": "^3.0.0", - "bittorrent-swarm": "^5.0.0", + "bittorrent-swarm": "https://github.com/solderzzc/bittorrent-swarm.git", "block-stream2": "^1.0.0", "clivas": "^0.2.0", "create-torrent": "^3.4.0", From 5e652744610b2a4fa574245688bf25ec3f7d762a Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Wed, 29 Jul 2015 15:07:22 -0700 Subject: [PATCH 006/109] Added command line hook scripts(done/exit). Give a chance for the programs use webtorrent cli to run scripts when download done or exit. --- bin/cmd.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/bin/cmd.js b/bin/cmd.js index f70a93ef..643d776e 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -45,6 +45,8 @@ var argv = minimist(process.argv.slice(2), { i: 'index', o: 'out', q: 'quiet', + d: 'done', + e: 'exit', h: 'help', v: 'version' }, @@ -93,6 +95,30 @@ if (argv.subtitles) { OMX_EXEC += ' --subtitles ' + argv.subtitles } +function checkPermission(filename){ + try { + var stats = fs.lstatSync(filename) + if (!stats.isFile()) { + errorAndExit("Your script "+ filename +" is not exist") + } + // check if the script has executable permission + if(!(1 & parseInt ((stats.mode & parseInt ("777", 8)).toString (8)[0]))){ + errorAndExit(filename+" don't have executable permission") + } + return fs.realpathSync(filename) + } + catch (err) { + errorAndExit(err) + } +} + +if (argv.done) { + var doneScript = checkPermission(argv.done) +} +if (argv.exit) { + var exitScript = checkPermission(argv.exit) +} + playerName = argv.airplay ? 'Airplay' : argv.chromecast ? 'Chromecast' : argv.xbmc ? 'XBMC' @@ -172,6 +198,8 @@ Options (all): -p, --port [number] change the http port [default: 8000] -b, --blocklist [path] load blocklist file/http url -t, --subtitles [file] load subtitles file + -d, --done [script] run script after download done + -e, --exit [script] run script during exiting -q, --quiet don't show UI on stdout -v, --version print the current version --verbose show detailed torrent protocol info @@ -584,8 +612,28 @@ function drawTorrent (torrent) { clivas.flush(true) } } +function getTorrentInfo(){ + var params = [] + if (client){ + var torrent = client.torrents[0] + if (torrent){ + var torrentFilename=path.join(torrent.storage.path,torrent.infoHash)+'.torrent' + + try { + fs.writeFileSync(torrentFilename, torrent.torrentFile) + } catch(err){ + torrentFilename = "" + } + params.push(torrentFilename) + params.push(path.join(torrent.storage.path,torrent.name)) + params.push(torrent.magnetURI) + } + } + return params +} function torrentDone () { + if (doneScript) cp.execFile(doneScript, getTorrentInfo()).unref() if (!playerName && !serving && argv.out) gracefulExit() } @@ -604,6 +652,7 @@ function gracefulExit () { // destroying can take a while, so print a message to the user clivas.line('\n{green:webtorrent is gracefully exiting...}') + if (exitScript) cp.execFile(exitScript, getTorrentInfo()).unref() client.destroy(function (err) { if (err) return errorAndExit(err) From fc459af30f6d5f7ba43187fb2dfbfdc249024f6c Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Wed, 29 Jul 2015 15:30:19 -0700 Subject: [PATCH 007/109] Fixed for CI Style check --- bin/cmd.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index 643d776e..bd91b5f4 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -95,19 +95,18 @@ if (argv.subtitles) { OMX_EXEC += ' --subtitles ' + argv.subtitles } -function checkPermission(filename){ +function checkPermission (filename) { try { var stats = fs.lstatSync(filename) if (!stats.isFile()) { - errorAndExit("Your script "+ filename +" is not exist") + errorAndExit('Your script ' + filename + ' is not exist') } // check if the script has executable permission - if(!(1 & parseInt ((stats.mode & parseInt ("777", 8)).toString (8)[0]))){ - errorAndExit(filename+" don't have executable permission") + if (!(1&parseInt((stats.mode & parseInt('777', 8)).toString(8)[0]))) { + errorAndExit(filename + ' don\'t have executable permission') } return fs.realpathSync(filename) - } - catch (err) { + } catch (err) { errorAndExit(err) } } @@ -612,21 +611,21 @@ function drawTorrent (torrent) { clivas.flush(true) } } -function getTorrentInfo(){ +function getTorrentInfo () { var params = [] - if (client){ + if (client) { var torrent = client.torrents[0] - if (torrent){ - var torrentFilename=path.join(torrent.storage.path,torrent.infoHash)+'.torrent' + if (torrent) { + var torrentFilename = path.join(torrent.storage.path, torrent.infoHash) + '.torrent' try { fs.writeFileSync(torrentFilename, torrent.torrentFile) - } catch(err){ - torrentFilename = "" + } catch(err) { + torrentFilename = '' } params.push(torrentFilename) - params.push(path.join(torrent.storage.path,torrent.name)) + params.push(path.join(torrent.storage.path, torrent.name)) params.push(torrent.magnetURI) } } From 9985c83985ae8c1ff328174eb763b1d9082f2096 Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Wed, 29 Jul 2015 15:40:23 -0700 Subject: [PATCH 008/109] Fixed for CI style check. --- bin/cmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cmd.js b/bin/cmd.js index bd91b5f4..d7839745 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -102,7 +102,7 @@ function checkPermission (filename) { errorAndExit('Your script ' + filename + ' is not exist') } // check if the script has executable permission - if (!(1&parseInt((stats.mode & parseInt('777', 8)).toString(8)[0]))) { + if (!(1 & (parseInt((stats.mode & parseInt('777', 8)).toString(8)[0])))) { errorAndExit(filename + ' don\'t have executable permission') } return fs.realpathSync(filename) From 7ee909f9873a6e3957bce916861200d92d8bbd14 Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Wed, 29 Jul 2015 15:47:37 -0700 Subject: [PATCH 009/109] Fixed for CI style check. --- bin/cmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cmd.js b/bin/cmd.js index d7839745..cbfbf3df 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -102,7 +102,7 @@ function checkPermission (filename) { errorAndExit('Your script ' + filename + ' is not exist') } // check if the script has executable permission - if (!(1 & (parseInt((stats.mode & parseInt('777', 8)).toString(8)[0])))) { + if (!(1 & parseInt((stats.mode & parseInt('777', 8)).toString(8)[0], 10))) { errorAndExit(filename + ' don\'t have executable permission') } return fs.realpathSync(filename) From 3a9ea8ef1302ab6dc4065d553f0521f8483ee8c6 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 30 Jul 2015 02:31:34 -0700 Subject: [PATCH 010/109] command line cleanup --- bin/cmd.js | 119 +++++++++++++++++++++++---------------------------- package.json | 1 + 2 files changed, 55 insertions(+), 65 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index cbfbf3df..a3eaebf3 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -3,6 +3,7 @@ var clivas = require('clivas') var cp = require('child_process') var createTorrent = require('create-torrent') +var executable = require('executable') var fs = require('fs') var inquirer = require('inquirer') var minimist = require('minimist') @@ -17,18 +18,17 @@ var zeroFill = require('zero-fill') process.title = 'WebTorrent' +var expectedError = false process.on('exit', function (code) { - if (code !== 0) { - clivas.line('{red:ERROR:} If you think this is a bug in WebTorrent, report it!\n') - console.log('=====> <=====') - console.log('=====> https://github.com/feross/webtorrent/issues <=====') - console.log('=====> <=====') + if (code !== 0 && !expectedError) { + clivas.line('\n{red:UNEXPECTED ERROR:} If this is a bug in WebTorrent, report it!') + clivas.line('{green:OPEN AN ISSUE:} https://github.com/feross/webtorrent/issues\n') clivas.line( - '\n{green:DEBUG INFO:} ' + + 'DEBUG INFO: ' + + 'webtorrent ' + require('../package.json').version + ', ' + 'node ' + process.version + ', ' + process.platform + ' ' + process.arch + ', ' + - 'webtorrent ' + require('../package.json').version + ', ' + - 'exit ' + code + '\n' + 'exit ' + code ) } }) @@ -45,8 +45,6 @@ var argv = minimist(process.argv.slice(2), { i: 'index', o: 'out', q: 'quiet', - d: 'done', - e: 'exit', h: 'help', v: 'version' }, @@ -64,6 +62,13 @@ var argv = minimist(process.argv.slice(2), { 'version', 'verbose' ], + string: [ // options that are always strings + 'out', + 'blocklist', + 'subtitles', + 'on-done', + 'on-exit' + ], default: { port: 8000 } @@ -97,25 +102,22 @@ if (argv.subtitles) { function checkPermission (filename) { try { - var stats = fs.lstatSync(filename) - if (!stats.isFile()) { - errorAndExit('Your script ' + filename + ' is not exist') + if (!executable.sync(filename)) { + errorAndExit('Script "' + filename + '" is not executable') } - // check if the script has executable permission - if (!(1 & parseInt((stats.mode & parseInt('777', 8)).toString(8)[0], 10))) { - errorAndExit(filename + ' don\'t have executable permission') - } - return fs.realpathSync(filename) } catch (err) { - errorAndExit(err) + errorAndExit('Script "' + filename + '" does not exist') } } -if (argv.done) { - var doneScript = checkPermission(argv.done) +if (argv['on-done']) { + checkPermission(argv['on-done']) + argv['on-done'] = fs.realpathSync(argv['on-done']) } -if (argv.exit) { - var exitScript = checkPermission(argv.exit) + +if (argv['on-exit']) { + checkPermission(argv['on-exit']) + argv['on-exit'] = fs.realpathSync(argv['on-exit']) } playerName = argv.airplay ? 'Airplay' @@ -190,18 +192,21 @@ Options (streaming): --xbmc XBMC --stdout standard out (implies --quiet) -Options (all): +Options (simple): -o, --out [path] set download destination [default: /tmp/webtorrent] -s, --select select individual file in torrent (by index) - -i, --index [index] stream a particular file from torrent (by index) - -p, --port [number] change the http port [default: 8000] + -i, --index [number] stream a particular file from torrent (by index) + -v, --version print the current version + +Options (advanced): + -p, --port [number] change the http server port [default: 8000] + -t, --subtitles [path] load subtitles file -b, --blocklist [path] load blocklist file/http url - -t, --subtitles [file] load subtitles file - -d, --done [script] run script after download done - -e, --exit [script] run script during exiting -q, --quiet don't show UI on stdout - -v, --version print the current version - --verbose show detailed torrent protocol info + --on-done [script] run script after torrent download is done + --on-exit [script] run script before program exit + --verbose show torrent protocol details + */ }.toString().split(/\n/).slice(2, -2).join('\n')) process.exit(0) @@ -220,7 +225,7 @@ function runInfo (torrentId) { try { parsedTorrent = parseTorrent(fs.readFileSync(torrentId)) } catch (err) { - errorAndExit(err) + return errorAndExit(err) } } @@ -252,7 +257,7 @@ function runDownload (torrentId) { client = new WebTorrent({ blocklist: argv.blocklist }) - .on('error', errorAndExit) + .on('error', fatalError) var torrent = client.add(torrentId, { path: argv.out }) @@ -321,7 +326,7 @@ function runDownload (torrentId) { if (argv.select) { var interactive = process.stdin.isTTY && !!process.stdin.setRawMode if (interactive) { - if (torrent.files.length === 0) errorAndExit('No files in the torrent') + if (torrent.files.length === 0) return errorAndExit('No files in the torrent') var cli = inquirer.prompt([{ type: 'list', @@ -383,7 +388,7 @@ function runDownload (torrentId) { VLC_ARGS = VLC_ARGS.split(' ') VLC_ARGS.unshift(href) cp.execFile(vlcPath, VLC_ARGS, function (err) { - if (err) return errorAndExit(err) + if (err) return fatalError(err) torrentDone() }).unref() } @@ -403,7 +408,7 @@ function runDownload (torrentId) { if (cmd) { cp.exec(cmd, function (err) { - if (err) return errorAndExit(err) + if (err) return fatalError(err) torrentDone() }).unref() } @@ -453,7 +458,7 @@ function runSeed (input) { client = new WebTorrent({ blocklist: argv.blocklist }) - .on('error', errorAndExit) + .on('error', fatalError) client.seed(input) @@ -611,50 +616,34 @@ function drawTorrent (torrent) { clivas.flush(true) } } -function getTorrentInfo () { - var params = [] - if (client) { - var torrent = client.torrents[0] - if (torrent) { - var torrentFilename = path.join(torrent.storage.path, torrent.infoHash) + '.torrent' - - try { - fs.writeFileSync(torrentFilename, torrent.torrentFile) - } catch(err) { - torrentFilename = '' - } - params.push(torrentFilename) - params.push(path.join(torrent.storage.path, torrent.name)) - params.push(torrent.magnetURI) - } - } - return params -} function torrentDone () { - if (doneScript) cp.execFile(doneScript, getTorrentInfo()).unref() + if (argv['on-done']) cp.exec(argv['on-done']).unref() if (!playerName && !serving && argv.out) gracefulExit() } +function fatalError (err) { + clivas.line('{red:Error:} ' + (err.message || err)) + process.exit(1) +} + function errorAndExit (err) { - clivas.line('{red:ERROR:} ' + (err.message || err)) + clivas.line('{red:Error:} ' + (err.message || err)) + expectedError = true process.exit(1) } function gracefulExit () { process.removeListener('SIGINT', gracefulExit) process.removeListener('SIGTERM', gracefulExit) - clearInterval(drawInterval) - if (client) { - // destroying can take a while, so print a message to the user - clivas.line('\n{green:webtorrent is gracefully exiting...}') + clivas.line('\n{green:webtorrent is gracefully exiting...}') - if (exitScript) cp.execFile(exitScript, getTorrentInfo()).unref() + if (client) { + if (argv['on-exit']) cp.exec(argv['on-exit']).unref() client.destroy(function (err) { - if (err) return errorAndExit(err) - + if (err) return fatalError(err) // Quit after 1 second. This shouldn't be necessary, node never quits even though // there's nothing in the event loop when `wrtc` (webtorrent-hybrid) is used :( setTimeout(function () { process.exit(0) }, 1000).unref() diff --git a/package.json b/package.json index a7e33ae0..c6409752 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "debug": "^2.1.0", "dezalgo": "^1.0.1", "end-of-stream": "^1.0.0", + "executable": "^1.1.0", "hat": "0.0.3", "inherits": "^2.0.1", "inquirer": "^0.8.0", From 3eb14c68b8219a578849b621cbf5d0e1377ee5b4 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 30 Jul 2015 02:33:27 -0700 Subject: [PATCH 011/109] 0.55.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c6409752..0d2aac83 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.54.3", + "version": "0.55.0", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From d13db6313fc2049c70736b465a40f1a9fdea8b4b Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 30 Jul 2015 02:37:17 -0700 Subject: [PATCH 012/109] build --- webtorrent.min.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 9c73fc11..54128e33 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,12 +1,12 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=this._parserSize){var i=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[i.slice(this._parserSize)]:[];this._parser(i.slice(0,this._parserSize))}n(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,n){var i=n?n.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+i-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,n){for(var i=0;i>3;if(e%8!==0)t++;return t}n.prototype.get=function(e){var t=e>>3;return t>e%8)};n.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};n.prototype._grow=function(e){if(this.buffer.length=31}r.formatters.j=function(e){return JSON.stringify(e)};function i(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){a=i}});e.splice(a,0,n);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":9}],9:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function a(){return r.colors[n++%r.colors.length]}function s(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var s=t-(i||t);e.diff=s;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;f++;var i=r.formatters[n];if("function"===typeof i){var a=o[f];t=i.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=n.log||r.log||console.log.bind(console);u.apply(e,o)}n.enabled=true;var s=r.enabled(e)?n:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,i,"minute")||c(e,n,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return n(e,t)}else return s};n.rack=function(e,t,r){var i=function(i){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=n(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=i;return o};var a=i.hats={};i.get=function(e){return i.hats[e]};i.set=function(e,t){i.hats[e]=t;return i};i.bits=e||128;i.base=t||16;return i}},{}],12:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],13:[function(e,t,r){var n=1;var i=65535;var a=4;var s=function(){n=n+1&i};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=n-1&i;return function(e){var f=n-o&i;if(f>t)f=t;o=n;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=i(t.addr);var n={host:r[0],port:r[1]};if(e._hostname)n.localAddress=e._hostname;var s=t.conn=u.connect(n);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var n=setTimeout(function i(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(n.unref)n.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=i(e);var n=r[0];var a=r[1];return a>0&&a<65535&&!(n==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":16,"./lib/tcp-pool":17,_process:180,"addr-to-ip-port":171,buffer:172,debug:20,dezalgo:23,events:176,inherits:27,net:171,speedometer:28}],16:[function(e,t,r){var n=e("debug")("bittorrent-swarm:peer");var i=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var n=new f(e);n.swarm=r;n.conn=new i(e,t);n.onConnect();return n};function f(e){var t=this;t.id=e;n("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;n("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var i=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(i!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}n("Peer %s got handshake %s",r.id,i);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;n("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var i=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(i)i.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":18,"bittorrent-protocol":2,debug:20}],17:[function(e,t,r){(function(r){t.exports=f;var n=e("debug")("bittorrent-swarm:tcp-pool");var i=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};n("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var n=o[e._port];if(!n)return t();n.removeSwarm(e);var i=0;for(var a in n.swarms){var s=n.swarms[a];if(s)i+=1}if(i===0)n.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}n("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;n("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=i(e);n("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;n("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var i in e.swarms){var a=e.swarms[i];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){ -t.pendingConns.splice(t.pendingConns.indexOf(e))}var n=s.createIncomingTCPPeer(e);n.wire.once("handshake",function(i,a){var s=i.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){n.swarm=o;o._addIncomingPeer(n);n.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+n.id+": destroying peer");n.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var n=t.swarms[r];if(n){t.removeSwarm(n);n._onError(e)}}}}).call(this,e("_process"))},{"./peer":16,_process:180,debug:20,dezalgo:23,net:171}],18:[function(e,t,r){(function(r){t.exports=f;var n=e("bitfield");var i=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,i){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new n(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){i("choke")});a.on("unchoke",function(){i("unchoke")});a.once("interested",function(){i("interested");a.unchoke()});a.on("uninterested",function(){i("uninterested")});a.on("bitfield",function(){i("bitfield")});a.on("request",function(e,t,r,n){i("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,n)})}f.prototype.httpRequest=function(e,t,r,n){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return n(e);if(r.statusCode<200||r.statusCode>=300){return n(new Error("Unexpected HTTP status code "+r.statusCode))}i("Got data of length %d",t.length);n(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:19,"bittorrent-protocol":2,buffer:172,debug:20,inherits:27,"simple-get":108}],19:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:172,dup:7}],20:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":21,dup:8}],21:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:22}],22:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],23:[function(e,t,r){var n=e("wrappy");t.exports=n(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function r(){var r=arguments;var n=this;if(t)i(function(){e.apply(n,r)});else e.apply(n,r)}}},{asap:24,wrappy:26}],24:[function(e,t,r){"use strict";var n=e("./raw");var i=[];var a=[];var s=n.makeRequestCallFromTimer(o);function o(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(i.length){t=i.pop()}else{t=new u}t.task=e;n(t)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);s()}}finally{this.task=null;i[i.length]=this}}},{"./raw":25}],25:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!n.length){a();i=true}n[n.length]=e}var n=[];var i=false;var a;var s=0;var o=1024;function f(){while(so){for(var t=0,r=n.length-s;t1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(n,i){if(n)return r(n);if(Array.isArray(i))i=l(i);else i=[i];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;i.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,i)})}function x(e,t){t=m(t);c.stat(e,function(r,n){if(r)return t(r);var i={length:n.size,path:e};t(null,i)})}function k(e,t,r){c.readdir(e,function(n,i){if(n&&n.code==="ENOTDIR"){t(e,r)}else if(n){r(n)}else{v(i.filter(S).filter(d.not).map(function(r){return function(n){k(o.join(e,r),t,n)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var i=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){i[t]=e;f-=1;_()});f+=1;u+=1}function v(){l=true;_()}function y(e){b();r(e)}function b(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function _(){if(l&&f===0){b();r(null,new n(i.join(""),"hex"),s)}}}function A(e,n,a){var o=n.announceList;if(!o){if(typeof n.announce==="string")o=[[n.announce]];else if(Array.isArray(n.announce)){o=n.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}var f={info:{name:n.name},announce:o[0][0],"announce-list":o,"creation date":Number(n.creationDate)||Date.now(),encoding:"UTF-8"};if(n.comment!==undefined)f.comment=n.comment;if(n.createdBy!==undefined)f["created by"]=n.createdBy;if(n.private!==undefined)f.info.private=Number(n.private);if(n.sslCert!==undefined)f.info["ssl-cert"]=n.sslCert;if(n.urlList!==undefined)f["url-list"]=n.urlList;var u=n.pieceLength||s(e.reduce(T,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(n.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,i.encode(f))})}function T(e,t){return e+t.length}function U(e){return typeof Blob!=="undefined"&&e instanceof Blob}function I(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,n){t.length+=e.length;this.push(e);n()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:49,"block-stream2":53,buffer:172,dezalgo:65,"filestream/read":72,flatten:73,fs:170,"is-file":74,junk:75,multistream:87,once:77,path:179,"piece-length":78,"run-parallel":103,"simple-sha1":80,stream:198}],49:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":50,"./lib/encode":52,dup:3}],50:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":51,buffer:172,dup:4}],51:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],52:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:172,dup:6}],53:[function(e,t,r){(function(r){var n=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=s;n(s,i);function s(e,t){if(!(this instanceof s))return new s(e,t);i.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,n){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}n()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:172,defined:54,inherits:55,"readable-stream":64}],54:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}w(e,t)}}else if(!i){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)U(this);else b(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)U(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=T(e,t);else i=null;if(o.isNull(i)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)U(this);if(!o.isNull(i))this.emit("data",i);return i};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){_(e)});else _(e)}}function _(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(a)o=r.join("");else o=i.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r1){var r=[];for(var n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:172}],64:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":56,"./lib/_stream_passthrough.js":57,"./lib/_stream_readable.js":58,"./lib/_stream_transform.js":59,"./lib/_stream_writable.js":60,stream:198}],65:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:66,dup:23,wrappy:68}],66:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":67,dup:24}],67:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],68:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],69:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],70:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:172,"is-typedarray":71}],71:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return i[n.call(e)]}},{}],72:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(o,n);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:69,stream:198,"typedarray-to-buffer":70}],73:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n=r){break}r=n;i=t[a]}return i}},{}],80:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=i.digest.bind(i);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function n(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:81}],81:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[i+u+1|0]=a.charCodeAt(r+u+2);case 2:e[i+u+2|0]=a.charCodeAt(r+u+1);case 1:e[i+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[i+u+1|0]=a[r+u+2];case 2:e[i+u+2|0]=a[r+u+1];case 1:e[i+u+3|0]=a[r+u]}};var l=function(e,t,r,n,a){var s=this,o,f=a%4,u=n%4,l=n-u;var c=new Uint8Array(i.readAsArrayBuffer(s.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);s(i,e);o(i,e,r);return n};var y=function(e,r,n){c(e)(t.h8,t.h32,r,n,0)};var b=function(e,r,n,i,a){var s=n;if(a){s=g(n,i)}y(e,r,n);t.core.hash(s,t.padMaxChunkLen)};var _=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){b(e,n,i,r,false)}b(e,n,r-n,r,true);return _(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}n._core=function s(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=n[t+320>>2]|0;o=n[t+324>>2]|0;u=n[t+328>>2]|0;c=n[t+332>>2]|0;d=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(i=0;(i|0)<64;i=i+4|0){v=n[r+i>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[e+i>>2]=v}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}n[t+320>>2]=a;n[t+324>>2]=o;n[t+328>>2]=u;n[t+332>>2]=c;n[t+336>>2]=d}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],82:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function s(e){var t={};var i=e.split("magnet:?")[1];var s=i&&i.length>=0?i.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var i=n.decode(o[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:172,"thirty-two":83,uniq:85,xtend:86}],83:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":84}],84:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var s=0;var o=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;n++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)n++}f[a]=t.charCodeAt(o);a++}for(n=a;n>>r;o[s]=a;s++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:172}],85:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],86:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],87:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();this._queue.forEach(function(e){if(e.destroy)e.destroy()});if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;var t=e._queue.shift();if(typeof t==="function")t=s(t());if(!t){e.destroy();e.push(null);return}e._current=t;t.on("readable",r);t.on("end",i);t.on("error",a);t.on("close",n);function r(){e._forward()}function n(){if(!t._readableState.ended){e.destroy()}}function i(){e._current=null;t.removeListener("readable",r);t.removeListener("end",i);t.removeListener("error",a);t.removeListener("close",n);e._next()}function a(t){e.destroy(t)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:88,stream:198}],88:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],89:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=n.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:172,http:199,https:177,"object-assign":109,once:111,"unzip-response":171,url:209}],109:[function(e,t,r){"use strict";var n=Object.prototype.propertyIsEnumerable;function i(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return n.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var n;var s=i(e);for(var o=1;on._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remoteFamily="IPv4";e.remotePort=Number(t.portNumber);e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:172,debug:113,"get-browser-rtc":116,hat:117,inherits:118,"is-typedarray":119,once:121,stream:198,"typedarray-to-buffer":139}],113:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":114,dup:8}],114:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:115}],115:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],116:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],117:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],118:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],119:[function(e,t,r){arguments[4][71][0].apply(r,arguments)},{dup:71}],120:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],121:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40,wrappy:120}],122:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;i(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var i=r._ws;var a=function(){i.onclose=null;r.emit("close")};try{i.onclose=a;i.close()}catch(e){a()}i.onopen=null;i.onmessage=null;i.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=o(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:172,debug:123,inherits:126,"is-typedarray":127,stream:198,"typedarray-to-buffer":139,ws:171}],123:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":124,dup:8}],124:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:125}],125:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],126:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],127:[function(e,t,r){arguments[4][71][0].apply(r,arguments)},{dup:71}],128:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("torrent-discovery");var a=e("bittorrent-dht/client");var s=e("events").EventEmitter;var o=e("xtend/mutable");var f=e("inherits");var u=e("run-parallel");var l=e("re-emitter");var c=e("bittorrent-tracker/client");f(p,s);function p(e){var t=this;if(!(t instanceof p))return new p(e);s.call(t);o(t,{announce:[],dht:typeof a==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t.infoHash=null;t.infoHashHex=null;t.torrent=null;t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}p.prototype.setTorrent=function(e){var t=this;if(!t.infoHash&&n.isBuffer(e)||typeof e==="string"){t.infoHash=typeof e==="string"?new n(e,"hex"):e}else if(!t.torrent&&e&&e.infoHash){t.torrent=e;t.infoHash=typeof e.infoHash==="string"?new n(e.infoHash,"hex"):e.infoHash}else{return}t.infoHashHex=t.infoHash.toString("hex");i("setTorrent %s",t.infoHashHex);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};p.prototype.stop=function(e){var t=this;var r=[];if(t.tracker&&t.tracker!==true){t.tracker.stop();r.push(function(e){t.tracker.destroy(e)})}if(!t._externalDHT&&t.dht&&t.dht!==true){r.push(function(e){t.dht.destroy(e)})}u(r,e)};p.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new a;l(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHashHex)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};p.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHashHex,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);l(e.tracker,e,["peer","warning","error"]);e.tracker.on("update",function(t){e.emit("trackerAnnounce",t)});e.tracker.start()};p.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"),e("buffer").Buffer)},{_process:180,"bittorrent-dht/client":171,"bittorrent-tracker/client":29,buffer:172,debug:129,events:176,inherits:132,"re-emitter":102,"run-parallel":133,"xtend/mutable":138}],129:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":130,dup:8}],130:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:131}],131:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],132:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],133:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dezalgo:134,dup:41}],134:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:135,dup:23,wrappy:137}],135:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":136,dup:24}],136:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],137:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],138:[function(e,t,r){arguments[4][47][0].apply(r,arguments)},{dup:47}],139:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{buffer:172,dup:70,"is-typedarray":140}],140:[function(e,t,r){arguments[4][71][0].apply(r,arguments)},{dup:71}],141:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var u=1e3;var l=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:u});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:142,bitfield:146,buffer:172,events:176,inherits:147,"simple-sha1":148}],142:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":143,"./lib/encode":145,dup:3}],143:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":144,buffer:172,dup:4}],144:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],145:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:172,dup:6}],146:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:172,dup:7}],147:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],148:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{dup:80,rusha:149}],149:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],150:[function(e,t,r){var n=e("debug")("webtorrent:append-to");var i=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var u=[".mp4",".m4v",".webm"];var l=[".m4a",".mp3"];var c=u.concat(l);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=i(r||function(){});var l;var v=s.extname(e.name).toLowerCase();var g=0;if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)y();else if(p.indexOf(v)>=0)_();else if(d.indexOf(v)>=0)w();else if(h.indexOf(v)>=0)x();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function y(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var i=u.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){n("Use `videostream` package for "+e.name);y();l.addEventListener("error",d);l.addEventListener("playing",b);o(e,l)}function c(){n("Use MediaSource API for "+e.name);y();l.addEventListener("error",h);l.addEventListener("playing",b);e.createReadStream().pipe(new a(l,{extname:v}));if(g)l.currentTime=g}function p(){n("Use Blob URL for "+e.name);y();l.addEventListener("error",k);l.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return k(e);l.src=t;if(g)l.currentTime=g})}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e);l.removeEventListener("error",d);l.removeEventListener("playing",b);c()}function h(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e);l.removeEventListener("error",h);l.removeEventListener("playing",b);p()}function y(e){if(!l){l=document.createElement(i);l.controls=true;l.autoplay=true;l.play();l.addEventListener("progress",function(){g=l.currentTime});t.appendChild(l)}}}function b(){l.removeEventListener("playing",b);r(null,l)}function _(){l=document.createElement("audio");l.controls=true;l.autoplay=true;t.appendChild(l);e.getBlobURL(function(e,t){if(e)return k(e);l.addEventListener("error",k);l.addEventListener("playing",b);l.src=t;l.play()})}function w(){e.getBlobURL(function(n,i){if(n)return k(n);l=document.createElement("img");l.src=i;l.alt=e.name;t.appendChild(l);r(null)})}function x(){e.getBlobURL(function(e,n){if(e)return k(e);l=document.createElement("iframe");l.src=n;if(v!==".pdf")l.sandbox="allow-forms allow-scripts";t.appendChild(l);r(null)})}function k(t){if(l)l.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;n(t.message);if(r)r(t)}}},{"./media-stream":152,debug:210,dezalgo:213,path:179,videostream:236}],151:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("stream");i(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var o=t.pieceLength;r.startPiece=i/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=i-r.startPiece*o}s.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,i){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}n("read %s (length %s) (err %s)",t,i.length,r&&r.message);if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],155:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'

"}).join("
");return r.end("

WebTorrent

    "+f+"
")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:210,http:199,mime:220,pump:224,"range-parser":225,url:209}],156:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var b=16*1024;var _=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/b;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=b;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(b,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*b;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*b)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||U});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};I.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;a_){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};I.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),A);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};I.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};I.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};I.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=L(e,E);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>k)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=k)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};I.prototype.createServer=function(e){var t=this;if(typeof y==="function"){var r=new y(t,e);t._servers.push(r);return r}};I.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function L(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function B(e){return Math.random()*e|0}function C(e,t){var r=e.map(function(e,t){return t});for(var n=r.length-1;n>0;--n){var i=B(n+1);var a=r[n];r[n]=r[i];r[i]=a}r.forEach(function(r){t(e[r],r,e)})}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":154,"./server":155,"./storage":156,_process:180,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":48,debug:210,events:176,inherits:219,"parse-torrent":97,"re-emitter":102,"run-parallel":103,"torrent-discovery":128,uniq:229,ut_metadata:141,ut_pex:171}],158:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:172,dup:7}],159:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{buffer:172,defined:160,dup:53,inherits:219,"readable-stream":169}],160:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{dup:54}],161:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{"./_stream_readable":163,"./_stream_writable":165,_process:180,"core-util-is":166,dup:56,inherits:219}],162:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{"./_stream_transform":164,"core-util-is":166,dup:57,inherits:219}],163:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{"./_stream_duplex":161,_process:180,buffer:172,"core-util-is":166,dup:58,events:176,inherits:219,isarray:167,stream:198,"string_decoder/":168,util:171}],164:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./_stream_duplex":161,"core-util-is":166,dup:59,inherits:219}],165:[function(e,t,r){arguments[4][60][0].apply(r,arguments)},{"./_stream_duplex":161,_process:180,buffer:172,"core-util-is":166,dup:60,inherits:219,stream:198}],166:[function(e,t,r){arguments[4][61][0].apply(r,arguments)},{buffer:172,dup:61}],167:[function(e,t,r){arguments[4][62][0].apply(r,arguments)},{dup:62}],168:[function(e,t,r){arguments[4][63][0].apply(r,arguments)},{buffer:172,dup:63}],169:[function(e,t,r){arguments[4][64][0].apply(r,arguments)},{"./lib/_stream_duplex.js":161,"./lib/_stream_passthrough.js":162,"./lib/_stream_readable.js":163,"./lib/_stream_transform.js":164,"./lib/_stream_writable.js":165,dup:64,stream:198}],170:[function(e,t,r){},{}],171:[function(e,t,r){arguments[4][170][0].apply(r,arguments)},{dup:170}],172:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=_;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return U(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function U(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Ue(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":173,ieee754:174,"is-array":175}],173:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],174:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],175:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],176:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],177:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:199}],178:[function(e,t,r){arguments[4][62][0].apply(r,arguments)},{dup:62}],179:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function T(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function U(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(_,".");var i=e.split(".");var a=T(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,b,_,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}_=B(e.charCodeAt(d++));if(_>=l||_>k((u-i)/y)){A("overflow")}i+=_*y;w=b<=s?c:b>=s+p?p:b-s;if(_k(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,b=[],_,w,x,E;e=I(e);_=e.length;t=v;r=0;a=m;for(s=0;s<_;++s){y=e[s];if(y<128){b.push(S(y))}}n=i=b.length;if(i){b.push(g)}while(n<_){for(o=u,s=0;s<_;++s){y=e[s];if(y>=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;s<_;++s){y=e[s];if(yu){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],183:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t)}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else _(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function b(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");U(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":200,_process:180,buffer:172,foreach:204,inherits:219,stream:198}],203:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],204:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString;t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r}},{}],208:[function(e,t,r){arguments[4][63][0].apply(r,arguments); -},{buffer:172,dup:63}],209:[function(e,t,r){var n=e("punycode");r.parse=b;r.resolve=w;r.resolveObject=x;r.format=_;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function b(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var b=-1;for(var _=0;_127){I+="x"}else{I+=U[L]}}if(!I.match(d)){var C=A.slice(0,_);var R=A.slice(_+1);var P=U.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var _=0;_0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var b=c.length;b>=0;b--){h=c[b];if(h=="."){c.splice(b,1)}else if(h===".."){c.splice(b,1);y++}else if(y){c.splice(b,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var _=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=_?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!_){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:181,querystring:184}],210:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":211,dup:8}],211:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:212}],212:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],213:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:214,dup:23,wrappy:216}],214:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":215,dup:24}],215:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],216:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],217:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:223}],218:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],219:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],220:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":217,fs:170,once:223}],225:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],226:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{dup:80,rusha:227}],227:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{dup:81}],228:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],229:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],230:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],231:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":234}],233:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>b){_++;b+=f.sample_counts[_]}k.cts=n.samples[t].dts+f.sample_offsets[_]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var b=0;if(!v){if(!g){if(t===0){b=l.fileStart}else{b=f}}else{b=l.fileStart}}else{b=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=b+m.data_offset}else{h.offset=b}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var _=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],235:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;a1e3){f("track-"+u+".mp4",l);l=null}}};var v;var g=null;var y=null;function b(t){if(t===e.length){p.flush();return}if(g&&t===v){return}if(g){g.destroy();y()}v=t;var r={start:v,end:e.length-1};g=e.createReadStream(r);function i(e){g.pause();if(h<=a){k()}var t=e.toArrayBuffer();t.fileStart=v;v+=t.byteLength;var r;try{r=p.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(c.readyState==="open"){c.endOfStream("decode")}g.destroy();y();return}b(r)}g.on("data",i);function s(){y();b(v)}g.on("end",s);function o(e){n("Stream error: %s",e.message);if(c.readyState==="open"){c.endOfStream("network")}}g.on("error",o);y=function(){g.removeListener("data",i);g.removeListener("end",s);g.removeListener("error",o);g=null;y=null}}function _(e){var t=p.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);b(t.offset);k()}function w(e,t,r){h+=t.byteLength;e.arrayBuffers.push({buffer:t,ended:r||false});x(e)}function x(e){if(e.buffer.updating||e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);e.arrayBuffers.unshift(t);setTimeout(function(){x(e)},o)}if(r){h-=t.buffer.byteLength;if(h<=s){k()}S()}}function k(){setTimeout(function(){if(g){if(g.isPaused?g.isPaused():!g._readableState.flowing){g.resume()}}})}function S(){if(c.readyState!=="open"){return}var e=Object.keys(m).every(function(e){var t=m[e];return t.ended&&!t.buffer.updating});if(e&&c.readyState==="open"){c.endOfStream()}}};function f(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:210,mp4box:235}],237:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],238:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.54.3",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],239:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var b=e("./lib/storage");var _=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:b;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a); -function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof _)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[239])(239)}); +(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=this._parserSize){var i=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[i.slice(this._parserSize)]:[];this._parser(i.slice(0,this._parserSize))}n(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,n){var i=n?n.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+i-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,n){for(var i=0;i>3;if(e%8!==0)t++;return t}n.prototype.get=function(e){var t=e>>3;return t>e%8)};n.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};n.prototype._grow=function(e){if(this.buffer.length=31}r.formatters.j=function(e){return JSON.stringify(e)};function i(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){a=i}});e.splice(a,0,n);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":9}],9:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function a(){return r.colors[n++%r.colors.length]}function s(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var s=t-(i||t);e.diff=s;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;f++;var i=r.formatters[n];if("function"===typeof i){var a=o[f];t=i.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=n.log||r.log||console.log.bind(console);u.apply(e,o)}n.enabled=true;var s=r.enabled(e)?n:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,i,"minute")||c(e,n,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return n(e,t)}else return s};n.rack=function(e,t,r){var i=function(i){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=n(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=i;return o};var a=i.hats={};i.get=function(e){return i.hats[e]};i.set=function(e,t){i.hats[e]=t;return i};i.bits=e||128;i.base=t||16;return i}},{}],12:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],13:[function(e,t,r){var n=1;var i=65535;var a=4;var s=function(){n=n+1&i};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=n-1&i;return function(e){var f=n-o&i;if(f>t)f=t;o=n;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=i(t.addr);var n={host:r[0],port:r[1]};if(e._hostname)n.localAddress=e._hostname;var s=t.conn=u.connect(n);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var n=setTimeout(function i(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(n.unref)n.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=i(e);var n=r[0];var a=r[1];return a>0&&a<65535&&!(n==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":16,"./lib/tcp-pool":17,_process:175,"addr-to-ip-port":166,buffer:167,debug:20,dezalgo:23,events:171,inherits:27,net:166,speedometer:28}],16:[function(e,t,r){var n=e("debug")("bittorrent-swarm:peer");var i=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var n=new f(e);n.swarm=r;n.conn=new i(e,t);n.onConnect();return n};function f(e){var t=this;t.id=e;n("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;n("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var i=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(i!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}n("Peer %s got handshake %s",r.id,i);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;n("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var i=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(i)i.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":18,"bittorrent-protocol":2,debug:20}],17:[function(e,t,r){(function(r){t.exports=f;var n=e("debug")("bittorrent-swarm:tcp-pool");var i=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};n("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var n=o[e._port];if(!n)return t();n.removeSwarm(e);var i=0;for(var a in n.swarms){var s=n.swarms[a];if(s)i+=1}if(i===0)n.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}n("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;n("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=i(e);n("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;n("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var i in e.swarms){var a=e.swarms[i];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){ +t.pendingConns.splice(t.pendingConns.indexOf(e))}var n=s.createIncomingTCPPeer(e);n.wire.once("handshake",function(i,a){var s=i.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){n.swarm=o;o._addIncomingPeer(n);n.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+n.id+": destroying peer");n.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var n=t.swarms[r];if(n){t.removeSwarm(n);n._onError(e)}}}}).call(this,e("_process"))},{"./peer":16,_process:175,debug:20,dezalgo:23,net:166}],18:[function(e,t,r){(function(r){t.exports=f;var n=e("bitfield");var i=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,i){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new n(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){i("choke")});a.on("unchoke",function(){i("unchoke")});a.once("interested",function(){i("interested");a.unchoke()});a.on("uninterested",function(){i("uninterested")});a.on("bitfield",function(){i("bitfield")});a.on("request",function(e,t,r,n){i("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,n)})}f.prototype.httpRequest=function(e,t,r,n){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return n(e);if(r.statusCode<200||r.statusCode>=300){return n(new Error("Unexpected HTTP status code "+r.statusCode))}i("Got data of length %d",t.length);n(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:19,"bittorrent-protocol":2,buffer:167,debug:20,inherits:27,"simple-get":103}],19:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:167,dup:7}],20:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":21,dup:8}],21:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:22}],22:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],23:[function(e,t,r){var n=e("wrappy");t.exports=n(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function r(){var r=arguments;var n=this;if(t)i(function(){e.apply(n,r)});else e.apply(n,r)}}},{asap:24,wrappy:26}],24:[function(e,t,r){"use strict";var n=e("./raw");var i=[];var a=[];var s=n.makeRequestCallFromTimer(o);function o(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(i.length){t=i.pop()}else{t=new u}t.task=e;n(t)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);s()}}finally{this.task=null;i[i.length]=this}}},{"./raw":25}],25:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!n.length){a();i=true}n[n.length]=e}var n=[];var i=false;var a;var s=0;var o=1024;function f(){while(so){for(var t=0,r=n.length-s;t1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(n,i){if(n)return r(n);if(Array.isArray(i))i=l(i);else i=[i];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;i.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,i)})}function x(e,t){t=m(t);c.stat(e,function(r,n){if(r)return t(r);var i={length:n.size,path:e};t(null,i)})}function k(e,t,r){c.readdir(e,function(n,i){if(n&&n.code==="ENOTDIR"){t(e,r)}else if(n){r(n)}else{v(i.filter(S).filter(d.not).map(function(r){return function(n){k(o.join(e,r),t,n)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var i=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){i[t]=e;f-=1;_()});f+=1;u+=1}function v(){l=true;_()}function y(e){b();r(e)}function b(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function _(){if(l&&f===0){b();r(null,new n(i.join(""),"hex"),s)}}}function A(e,n,a){var o=n.announceList;if(!o){if(typeof n.announce==="string")o=[[n.announce]];else if(Array.isArray(n.announce)){o=n.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}var f={info:{name:n.name},announce:o[0][0],"announce-list":o,"creation date":Number(n.creationDate)||Date.now(),encoding:"UTF-8"};if(n.comment!==undefined)f.comment=n.comment;if(n.createdBy!==undefined)f["created by"]=n.createdBy;if(n.private!==undefined)f.info.private=Number(n.private);if(n.sslCert!==undefined)f.info["ssl-cert"]=n.sslCert;if(n.urlList!==undefined)f["url-list"]=n.urlList;var u=n.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(n.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,i.encode(f))})}function U(e,t){return e+t.length}function T(e){return typeof Blob!=="undefined"&&e instanceof Blob}function I(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,n){t.length+=e.length;this.push(e);n()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:44,"block-stream2":48,buffer:167,dezalgo:60,"filestream/read":67,flatten:68,fs:165,"is-file":69,junk:70,multistream:82,once:72,path:174,"piece-length":73,"run-parallel":98,"simple-sha1":75,stream:193}],44:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":45,"./lib/encode":47,dup:3}],45:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":46,buffer:167,dup:4}],46:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],47:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:167,dup:6}],48:[function(e,t,r){(function(r){var n=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=s;n(s,i);function s(e,t){if(!(this instanceof s))return new s(e,t);i.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,n){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}n()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:167,defined:49,inherits:50,"readable-stream":59}],49:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}w(e,t)}}else if(!i){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)T(this);else b(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)T(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=U(e,t);else i=null;if(o.isNull(i)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)T(this);if(!o.isNull(i))this.emit("data",i);return i};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){_(e)});else _(e)}}function _(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(a)o=r.join("");else o=i.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r1){var r=[];for(var n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:167}],59:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./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,stream:193}],60:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:61,dup:23,wrappy:63}],61:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":62,dup:24}],62:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],63:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],64:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],65:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:167,"is-typedarray":66}],66:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return i[n.call(e)]}},{}],67:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(o,n);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:64,stream:193,"typedarray-to-buffer":65}],68:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n=r){break}r=n;i=t[a]}return i}},{}],75:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=i.digest.bind(i);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function n(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:76}],76:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[i+u+1|0]=a.charCodeAt(r+u+2);case 2:e[i+u+2|0]=a.charCodeAt(r+u+1);case 1:e[i+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[i+u+1|0]=a[r+u+2];case 2:e[i+u+2|0]=a[r+u+1];case 1:e[i+u+3|0]=a[r+u]}};var l=function(e,t,r,n,a){var s=this,o,f=a%4,u=n%4,l=n-u;var c=new Uint8Array(i.readAsArrayBuffer(s.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);s(i,e);o(i,e,r);return n};var y=function(e,r,n){c(e)(t.h8,t.h32,r,n,0)};var b=function(e,r,n,i,a){var s=n;if(a){s=g(n,i)}y(e,r,n);t.core.hash(s,t.padMaxChunkLen)};var _=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){b(e,n,i,r,false)}b(e,n,r-n,r,true);return _(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}n._core=function s(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=n[t+320>>2]|0;o=n[t+324>>2]|0;u=n[t+328>>2]|0;c=n[t+332>>2]|0;d=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(i=0;(i|0)<64;i=i+4|0){v=n[r+i>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[e+i>>2]=v}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}n[t+320>>2]=a;n[t+324>>2]=o;n[t+328>>2]=u;n[t+332>>2]=c;n[t+336>>2]=d}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],77:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function s(e){var t={};var i=e.split("magnet:?")[1];var s=i&&i.length>=0?i.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var i=n.decode(o[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:167,"thirty-two":78,uniq:80,xtend:81}],78:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":79}],79:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var s=0;var o=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;n++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)n++}f[a]=t.charCodeAt(o);a++}for(n=a;n>>r;o[s]=a;s++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:167}],80:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],81:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],82:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();this._queue.forEach(function(e){if(e.destroy)e.destroy()});if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;var t=e._queue.shift();if(typeof t==="function")t=s(t());if(!t){e.destroy();e.push(null);return}e._current=t;t.on("readable",r);t.on("end",i);t.on("error",a);t.on("close",n);function r(){e._forward()}function n(){if(!t._readableState.ended){e.destroy()}}function i(){e._current=null;t.removeListener("readable",r);t.removeListener("end",i);t.removeListener("error",a);t.removeListener("close",n);e._next()}function a(t){e.destroy(t)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:83,stream:193}],83:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],84:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=n.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:167,http:194,https:172,"object-assign":104,once:106,"unzip-response":166,url:204}],104:[function(e,t,r){"use strict";var n=Object.prototype.propertyIsEnumerable;function i(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return n.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var n;var s=i(e);for(var o=1;on._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remoteFamily="IPv4";e.remotePort=Number(t.portNumber);e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:167,debug:108,"get-browser-rtc":111,hat:112,inherits:113,"is-typedarray":114,once:116,stream:193,"typedarray-to-buffer":134}],108:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":109,dup:8}],109:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:110}],110:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],111:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],112:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],113:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],114:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],115:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],116:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40,wrappy:115}],117:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;i(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var i=r._ws;var a=function(){i.onclose=null;r.emit("close")};if(i.readyState===u.CLOSED){a()}else{try{i.onclose=a;i.close()}catch(e){a()}}i.onopen=null;i.onmessage=null;i.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=o(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:167,debug:118,inherits:121,"is-typedarray":122,stream:193,"typedarray-to-buffer":134,ws:166}],118:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":119,dup:8}],119:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:120}],120:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],121:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],122:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],123:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("torrent-discovery");var a=e("bittorrent-dht/client");var s=e("events").EventEmitter;var o=e("xtend/mutable");var f=e("inherits");var u=e("run-parallel");var l=e("re-emitter");var c=e("bittorrent-tracker/client");f(p,s);function p(e){var t=this;if(!(t instanceof p))return new p(e);s.call(t);o(t,{announce:[],dht:typeof a==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t.infoHash=null;t.infoHashHex=null;t.torrent=null;t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}p.prototype.setTorrent=function(e){var t=this;if(!t.infoHash&&n.isBuffer(e)||typeof e==="string"){t.infoHash=typeof e==="string"?new n(e,"hex"):e}else if(!t.torrent&&e&&e.infoHash){t.torrent=e;t.infoHash=typeof e.infoHash==="string"?new n(e.infoHash,"hex"):e.infoHash}else{return}t.infoHashHex=t.infoHash.toString("hex");i("setTorrent %s",t.infoHashHex);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};p.prototype.stop=function(e){var t=this;var r=[];if(t.tracker&&t.tracker!==true){t.tracker.stop();r.push(function(e){t.tracker.destroy(e)})}if(!t._externalDHT&&t.dht&&t.dht!==true){r.push(function(e){t.dht.destroy(e)})}u(r,e)};p.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new a;l(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHashHex)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};p.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHashHex,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);l(e.tracker,e,["peer","warning","error"]);e.tracker.on("update",function(t){e.emit("trackerAnnounce",t)});e.tracker.start()};p.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"),e("buffer").Buffer)},{_process:175,"bittorrent-dht/client":166,"bittorrent-tracker/client":29,buffer:167,debug:124,events:171,inherits:127,"re-emitter":97,"run-parallel":128,"xtend/mutable":133}],124:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":125,dup:8}],125:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:126}],126:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],127:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],128:[function(e,t,r){arguments[4][98][0].apply(r,arguments)},{dezalgo:129,dup:98}],129:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:130,dup:23,wrappy:132}],130:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":131,dup:24}],131:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],132:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],133:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],134:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{buffer:167,dup:65,"is-typedarray":135}],135:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],136:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var u=1e3;var l=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:u});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:137,bitfield:141,buffer:167,events:171,inherits:142,"simple-sha1":143}],137:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":138,"./lib/encode":140,dup:3}],138:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":139,buffer:167,dup:4}],139:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],140:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:167,dup:6}],141:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:167,dup:7}],142:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],143:[function(e,t,r){arguments[4][75][0].apply(r,arguments)},{dup:75,rusha:144}],144:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{dup:76}],145:[function(e,t,r){var n=e("debug")("webtorrent:append-to");var i=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var u=[".mp4",".m4v",".webm"];var l=[".m4a",".mp3"];var c=u.concat(l);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=i(r||function(){});var l;var v=s.extname(e.name).toLowerCase();var g=0;if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)y();else if(p.indexOf(v)>=0)_();else if(d.indexOf(v)>=0)w();else if(h.indexOf(v)>=0)x();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function y(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var i=u.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){n("Use `videostream` package for "+e.name);y();l.addEventListener("error",d);l.addEventListener("playing",b);o(e,l)}function c(){n("Use MediaSource API for "+e.name);y();l.addEventListener("error",h);l.addEventListener("playing",b);e.createReadStream().pipe(new a(l,{extname:v}));if(g)l.currentTime=g}function p(){n("Use Blob URL for "+e.name);y();l.addEventListener("error",k);l.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return k(e);l.src=t;if(g)l.currentTime=g})}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e);l.removeEventListener("error",d);l.removeEventListener("playing",b);c()}function h(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e);l.removeEventListener("error",h);l.removeEventListener("playing",b);p()}function y(e){if(!l){l=document.createElement(i);l.controls=true;l.autoplay=true;l.play();l.addEventListener("progress",function(){g=l.currentTime});t.appendChild(l)}}}function b(){l.removeEventListener("playing",b);r(null,l)}function _(){l=document.createElement("audio");l.controls=true;l.autoplay=true;t.appendChild(l);e.getBlobURL(function(e,t){if(e)return k(e);l.addEventListener("error",k);l.addEventListener("playing",b);l.src=t;l.play()})}function w(){e.getBlobURL(function(n,i){if(n)return k(n);l=document.createElement("img");l.src=i;l.alt=e.name;t.appendChild(l);r(null)})}function x(){e.getBlobURL(function(e,n){if(e)return k(e);l=document.createElement("iframe");l.src=n;if(v!==".pdf")l.sandbox="allow-forms allow-scripts";t.appendChild(l);r(null)})}function k(t){if(l)l.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;n(t.message);if(r)r(t)}}},{"./media-stream":147,debug:205,dezalgo:208,path:174,videostream:231}],146:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("stream");i(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var o=t.pieceLength;r.startPiece=i/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=i-r.startPiece*o}s.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,i){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}n("read %s (length %s) (err %s)",t,i.length,r&&r.message);if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],150:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:205,http:194,mime:215,pump:219,"range-parser":220,url:204}],151:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var b=16*1024;var _=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/b;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=b;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(b,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*b;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*b)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||T});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};I.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;a_){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};I.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),A);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};I.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};I.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};I.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=L(e,E);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>k)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=k)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};I.prototype.createServer=function(e){var t=this;if(typeof y==="function"){var r=new y(t,e);t._servers.push(r);return r}};I.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function L(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function B(e){return Math.random()*e|0}function C(e,t){var r=e.map(function(e,t){return t});for(var n=r.length-1;n>0;--n){var i=B(n+1);var a=r[n];r[n]=r[i];r[i]=a}r.forEach(function(r){t(e[r],r,e)})}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":149,"./server":150,"./storage":151,_process:175,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":43,debug:205,events:171,inherits:214,"parse-torrent":92,"re-emitter":97,"run-parallel":98,"torrent-discovery":123,uniq:224,ut_metadata:136,ut_pex:166}],153:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:167,dup:7}],154:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:167,defined:155,dup:48,inherits:214,"readable-stream":164}],155:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],156:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{"./_stream_readable":158,"./_stream_writable":160,_process:175,"core-util-is":161,dup:51,inherits:214}],157:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{"./_stream_transform":159,"core-util-is":161,dup:52,inherits:214}],158:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{"./_stream_duplex":156,_process:175,buffer:167,"core-util-is":161,dup:53,events:171,inherits:214,isarray:162,stream:193,"string_decoder/":163,util:166}],159:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{"./_stream_duplex":156,"core-util-is":161,dup:54,inherits:214}],160:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./_stream_duplex":156,_process:175,buffer:167,"core-util-is":161,dup:55,inherits:214,stream:193}],161:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{buffer:167,dup:56}],162:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],163:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:167,dup:58}],164:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./lib/_stream_duplex.js":156,"./lib/_stream_passthrough.js":157,"./lib/_stream_readable.js":158,"./lib/_stream_transform.js":159,"./lib/_stream_writable.js":160,dup:59,stream:193}],165:[function(e,t,r){},{}],166:[function(e,t,r){arguments[4][165][0].apply(r,arguments)},{dup:165}],167:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=_;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ue(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":168,ieee754:169,"is-array":170}],168:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],169:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],170:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],171:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],172:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:194}],173:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],174:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function T(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(_,".");var i=e.split(".");var a=U(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,b,_,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}_=B(e.charCodeAt(d++));if(_>=l||_>k((u-i)/y)){A("overflow")}i+=_*y;w=b<=s?c:b>=s+p?p:b-s;if(_k(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,b=[],_,w,x,E;e=I(e);_=e.length;t=v;r=0;a=m;for(s=0;s<_;++s){y=e[s];if(y<128){b.push(S(y))}}n=i=b.length;if(i){b.push(g)}while(n<_){for(o=u,s=0;s<_;++s){y=e[s];if(y>=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;s<_;++s){y=e[s];if(yu){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],178:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t)}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else _(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function b(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":195,_process:175,buffer:167,foreach:199,inherits:214,stream:193}],198:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],199:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString;t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r; +}},{}],203:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:167,dup:58}],204:[function(e,t,r){var n=e("punycode");r.parse=b;r.resolve=w;r.resolveObject=x;r.format=_;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function b(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var b=-1;for(var _=0;_127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,_);var R=A.slice(_+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var _=0;_0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var b=c.length;b>=0;b--){h=c[b];if(h=="."){c.splice(b,1)}else if(h===".."){c.splice(b,1);y++}else if(y){c.splice(b,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var _=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=_?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!_){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:176,querystring:179}],205:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":206,dup:8}],206:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:207}],207:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],208:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:209,dup:23,wrappy:211}],209:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":210,dup:24}],210:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],211:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],212:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:218}],213:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],214:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],215:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":212,fs:165,once:218}],220:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],221:[function(e,t,r){arguments[4][75][0].apply(r,arguments)},{dup:75,rusha:222}],222:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{dup:76}],223:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],224:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],225:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],226:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":229}],228:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>b){_++;b+=f.sample_counts[_]}k.cts=n.samples[t].dts+f.sample_offsets[_]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var b=0;if(!v){if(!g){if(t===0){b=l.fileStart}else{b=f}}else{b=l.fileStart}}else{b=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=b+m.data_offset}else{h.offset=b}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var _=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],230:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;a1e3){f("track-"+u+".mp4",l);l=null}}};var v;var g=null;var y=null;function b(t){if(t===e.length){p.flush();return}if(g&&t===v){return}if(g){g.destroy();y()}v=t;var r={start:v,end:e.length-1};g=e.createReadStream(r);function i(e){g.pause();if(h<=a){k()}var t=e.toArrayBuffer();t.fileStart=v;v+=t.byteLength;var r;try{r=p.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(c.readyState==="open"){c.endOfStream("decode")}g.destroy();y();return}b(r)}g.on("data",i);function s(){y();b(v)}g.on("end",s);function o(e){n("Stream error: %s",e.message);if(c.readyState==="open"){c.endOfStream("network")}}g.on("error",o);y=function(){g.removeListener("data",i);g.removeListener("end",s);g.removeListener("error",o);g=null;y=null}}function _(e){var t=p.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);b(t.offset);k()}function w(e,t,r){h+=t.byteLength;e.arrayBuffers.push({buffer:t,ended:r||false});x(e)}function x(e){if(e.buffer.updating||e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);e.arrayBuffers.unshift(t);setTimeout(function(){x(e)},o)}if(r){h-=t.buffer.byteLength;if(h<=s){k()}S()}}function k(){setTimeout(function(){if(g){if(g.isPaused?g.isPaused():!g._readableState.flowing){g.resume()}}})}function S(){if(c.readyState!=="open"){return}var e=Object.keys(m).every(function(e){var t=m[e];return t.ended&&!t.buffer.updating});if(e&&c.readyState==="open"){c.endOfStream()}}};function f(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:205,mp4box:230}],232:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],233:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.55.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",executable:"^1.1.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],234:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var b=e("./lib/storage");var _=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:b;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message); +t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof _)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[234])(234)}); From 9400482ed048d4f14dd7f299641b2dd9b14c91d3 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 6 Aug 2015 22:38:49 +0200 Subject: [PATCH 013/109] fix examples --- examples/browser-seed.js | 2 +- examples/browser-stream-to-audio.js | 20 ------------------- ...js => browser-stream-to-video-or-audio.js} | 13 +++++------- 3 files changed, 6 insertions(+), 29 deletions(-) delete mode 100644 examples/browser-stream-to-audio.js rename examples/{browser-stream-to-video.js => browser-stream-to-video-or-audio.js} (50%) diff --git a/examples/browser-seed.js b/examples/browser-seed.js index cad10619..ea2fbbe7 100644 --- a/examples/browser-seed.js +++ b/examples/browser-seed.js @@ -1,4 +1,4 @@ -var dragDrop = require('drag-drop/buffer') +var dragDrop = require('drag-drop') var WebTorrent = require('webtorrent') var client = new WebTorrent() diff --git a/examples/browser-stream-to-audio.js b/examples/browser-stream-to-audio.js deleted file mode 100644 index 01c6499e..00000000 --- a/examples/browser-stream-to-audio.js +++ /dev/null @@ -1,20 +0,0 @@ -var WebTorrent = require('webtorrent') - -var client = new WebTorrent() -var magnetUri = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36' - -client.add(magnetUri, function (torrent) { - // Got torrent metadata! - console.log('Torrent info hash:', torrent.infoHash) - - // Let's say the first file is an mp3 audio file - var file = torrent.files[0] - - // Create an audio element - var audio = document.createElement('audio') - audio.controls = true - document.body.appendChild(audio) - - // Stream the audio into the audio tag - file.createReadStream().pipe(audio) -}) diff --git a/examples/browser-stream-to-video.js b/examples/browser-stream-to-video-or-audio.js similarity index 50% rename from examples/browser-stream-to-video.js rename to examples/browser-stream-to-video-or-audio.js index e721ceeb..dfd1b082 100644 --- a/examples/browser-stream-to-video.js +++ b/examples/browser-stream-to-video-or-audio.js @@ -1,7 +1,7 @@ var WebTorrent = require('webtorrent') var client = new WebTorrent() -var magnetUri = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36' +var magnetUri = '...' client.add(magnetUri, function (torrent) { // Got torrent metadata! @@ -10,11 +10,8 @@ client.add(magnetUri, function (torrent) { // Let's say the first file is a webm (vp8) or mp4 (h264) video... var file = torrent.files[0] - // Create a video element - var video = document.createElement('video') - video.controls = true - document.body.appendChild(video) - - // Stream the video into the video tag - file.createReadStream().pipe(video) + // Stream the video! + // Specify a container element (CSS selector or reference to DOM node) + file.appendTo('body') + }) }) From 57023a4acd79a0ab57481b8153024d3dcfc22181 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 6 Aug 2015 22:47:48 +0200 Subject: [PATCH 014/109] fix example --- examples/browser-stream-to-video-or-audio.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/browser-stream-to-video-or-audio.js b/examples/browser-stream-to-video-or-audio.js index dfd1b082..a1c63f2f 100644 --- a/examples/browser-stream-to-video-or-audio.js +++ b/examples/browser-stream-to-video-or-audio.js @@ -5,13 +5,11 @@ var magnetUri = '...' client.add(magnetUri, function (torrent) { // Got torrent metadata! - console.log('Torrent info hash:', torrent.infoHash) + console.log('Client is downloading:', torrent.infoHash) - // Let's say the first file is a webm (vp8) or mp4 (h264) video... - var file = torrent.files[0] - - // Stream the video! - // Specify a container element (CSS selector or reference to DOM node) - file.appendTo('body') + torrent.files.forEach(function (file) { + // Display the file by appending it to the DOM. Supports video, audio, images, and + // more. Specify a container element (CSS selector or reference to DOM node). + file.appendTo('body') }) }) From c0e8b3f128fcf33d0597c70f69b3ce60a620479a Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 14:24:53 +0200 Subject: [PATCH 015/109] fix todo: use random-iterate --- lib/torrent.js | 27 ++++++--------------------- package.json | 1 + 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index 40f7d4a3..034ebc9a 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -8,6 +8,7 @@ var EventEmitter = require('events').EventEmitter var inherits = require('inherits') var parallel = require('run-parallel') var parseTorrent = require('parse-torrent') +var randomIterate = require('random-iterate') var reemit = require('re-emitter') var Swarm = require('bittorrent-swarm') var uniq = require('uniq') @@ -760,7 +761,11 @@ Torrent.prototype._update = function () { if (self.destroyed) return // update wires in random order for better request distribution - randomizedForEach(self.swarm.wires, self._updateWire.bind(self)) + var ite = randomIterate(self.swarm.wires) + var wire + while ((wire = ite())) { + self._updateWire(wire) + } } /** @@ -1128,23 +1133,3 @@ function getPipelineLength (wire, duration) { function randomInt (high) { return Math.random() * high | 0 } - -/** - * TODO: use random-iterate module for this - * Iterates through the given array in a random order, calling the given - * callback for each element. - */ -function randomizedForEach (array, cb) { - var indices = array.map(function (value, index) { return index }) - - for (var i = indices.length - 1; i > 0; --i) { - var j = randomInt(i + 1) - var tmp = indices[i] - indices[i] = indices[j] - indices[j] = tmp - } - - indices.forEach(function (index) { - cb(array[index], index, array) - }) -} diff --git a/package.json b/package.json index 0d2aac83..133481c8 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "pretty-bytes": "^2.0.1", "pump": "^1.0.0", "random-access-file": "^0.3.1", + "random-iterate": "^1.0.1", "range-parser": "^1.0.2", "re-emitter": "^1.0.0", "rimraf": "^2.2.5", From 8f3c7c3e12370a9eb3bd522d7de1940ef782c2a0 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 14:38:16 +0200 Subject: [PATCH 016/109] 0.55.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 133481c8..8f85d2ce 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.55.0", + "version": "0.55.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From e4433fed4f4b1612046e35c3876fdafa477898fb Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 14:45:06 +0200 Subject: [PATCH 017/109] build --- webtorrent.min.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 54128e33..ce6505f3 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,12 +1,12 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=this._parserSize){var i=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[i.slice(this._parserSize)]:[];this._parser(i.slice(0,this._parserSize))}n(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,n){var i=n?n.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+i-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,n){for(var i=0;i>3;if(e%8!==0)t++;return t}n.prototype.get=function(e){var t=e>>3;return t>e%8)};n.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};n.prototype._grow=function(e){if(this.buffer.length=31}r.formatters.j=function(e){return JSON.stringify(e)};function i(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){a=i}});e.splice(a,0,n);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":9}],9:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function a(){return r.colors[n++%r.colors.length]}function s(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var s=t-(i||t);e.diff=s;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;f++;var i=r.formatters[n];if("function"===typeof i){var a=o[f];t=i.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=n.log||r.log||console.log.bind(console);u.apply(e,o)}n.enabled=true;var s=r.enabled(e)?n:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,i,"minute")||c(e,n,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return n(e,t)}else return s};n.rack=function(e,t,r){var i=function(i){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=n(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=i;return o};var a=i.hats={};i.get=function(e){return i.hats[e]};i.set=function(e,t){i.hats[e]=t;return i};i.bits=e||128;i.base=t||16;return i}},{}],12:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],13:[function(e,t,r){var n=1;var i=65535;var a=4;var s=function(){n=n+1&i};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=n-1&i;return function(e){var f=n-o&i;if(f>t)f=t;o=n;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=i(t.addr);var n={host:r[0],port:r[1]};if(e._hostname)n.localAddress=e._hostname;var s=t.conn=u.connect(n);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var n=setTimeout(function i(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(n.unref)n.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=i(e);var n=r[0];var a=r[1];return a>0&&a<65535&&!(n==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":16,"./lib/tcp-pool":17,_process:175,"addr-to-ip-port":166,buffer:167,debug:20,dezalgo:23,events:171,inherits:27,net:166,speedometer:28}],16:[function(e,t,r){var n=e("debug")("bittorrent-swarm:peer");var i=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var n=new f(e);n.swarm=r;n.conn=new i(e,t);n.onConnect();return n};function f(e){var t=this;t.id=e;n("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;n("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var i=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(i!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}n("Peer %s got handshake %s",r.id,i);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;n("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var i=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(i)i.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":18,"bittorrent-protocol":2,debug:20}],17:[function(e,t,r){(function(r){t.exports=f;var n=e("debug")("bittorrent-swarm:tcp-pool");var i=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};n("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var n=o[e._port];if(!n)return t();n.removeSwarm(e);var i=0;for(var a in n.swarms){var s=n.swarms[a];if(s)i+=1}if(i===0)n.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}n("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;n("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=i(e);n("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;n("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var i in e.swarms){var a=e.swarms[i];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){ -t.pendingConns.splice(t.pendingConns.indexOf(e))}var n=s.createIncomingTCPPeer(e);n.wire.once("handshake",function(i,a){var s=i.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){n.swarm=o;o._addIncomingPeer(n);n.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+n.id+": destroying peer");n.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var n=t.swarms[r];if(n){t.removeSwarm(n);n._onError(e)}}}}).call(this,e("_process"))},{"./peer":16,_process:175,debug:20,dezalgo:23,net:166}],18:[function(e,t,r){(function(r){t.exports=f;var n=e("bitfield");var i=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,i){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new n(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){i("choke")});a.on("unchoke",function(){i("unchoke")});a.once("interested",function(){i("interested");a.unchoke()});a.on("uninterested",function(){i("uninterested")});a.on("bitfield",function(){i("bitfield")});a.on("request",function(e,t,r,n){i("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,n)})}f.prototype.httpRequest=function(e,t,r,n){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return n(e);if(r.statusCode<200||r.statusCode>=300){return n(new Error("Unexpected HTTP status code "+r.statusCode))}i("Got data of length %d",t.length);n(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:19,"bittorrent-protocol":2,buffer:167,debug:20,inherits:27,"simple-get":103}],19:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:167,dup:7}],20:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":21,dup:8}],21:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:22}],22:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],23:[function(e,t,r){var n=e("wrappy");t.exports=n(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function r(){var r=arguments;var n=this;if(t)i(function(){e.apply(n,r)});else e.apply(n,r)}}},{asap:24,wrappy:26}],24:[function(e,t,r){"use strict";var n=e("./raw");var i=[];var a=[];var s=n.makeRequestCallFromTimer(o);function o(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(i.length){t=i.pop()}else{t=new u}t.task=e;n(t)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);s()}}finally{this.task=null;i[i.length]=this}}},{"./raw":25}],25:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!n.length){a();i=true}n[n.length]=e}var n=[];var i=false;var a;var s=0;var o=1024;function f(){while(so){for(var t=0,r=n.length-s;t1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(n,i){if(n)return r(n);if(Array.isArray(i))i=l(i);else i=[i];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;i.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,i)})}function x(e,t){t=m(t);c.stat(e,function(r,n){if(r)return t(r);var i={length:n.size,path:e};t(null,i)})}function k(e,t,r){c.readdir(e,function(n,i){if(n&&n.code==="ENOTDIR"){t(e,r)}else if(n){r(n)}else{v(i.filter(S).filter(d.not).map(function(r){return function(n){k(o.join(e,r),t,n)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var i=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){i[t]=e;f-=1;_()});f+=1;u+=1}function v(){l=true;_()}function y(e){b();r(e)}function b(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function _(){if(l&&f===0){b();r(null,new n(i.join(""),"hex"),s)}}}function A(e,n,a){var o=n.announceList;if(!o){if(typeof n.announce==="string")o=[[n.announce]];else if(Array.isArray(n.announce)){o=n.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}var f={info:{name:n.name},announce:o[0][0],"announce-list":o,"creation date":Number(n.creationDate)||Date.now(),encoding:"UTF-8"};if(n.comment!==undefined)f.comment=n.comment;if(n.createdBy!==undefined)f["created by"]=n.createdBy;if(n.private!==undefined)f.info.private=Number(n.private);if(n.sslCert!==undefined)f.info["ssl-cert"]=n.sslCert;if(n.urlList!==undefined)f["url-list"]=n.urlList;var u=n.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(n.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,i.encode(f))})}function U(e,t){return e+t.length}function T(e){return typeof Blob!=="undefined"&&e instanceof Blob}function I(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,n){t.length+=e.length;this.push(e);n()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:44,"block-stream2":48,buffer:167,dezalgo:60,"filestream/read":67,flatten:68,fs:165,"is-file":69,junk:70,multistream:82,once:72,path:174,"piece-length":73,"run-parallel":98,"simple-sha1":75,stream:193}],44:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":45,"./lib/encode":47,dup:3}],45:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":46,buffer:167,dup:4}],46:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],47:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:167,dup:6}],48:[function(e,t,r){(function(r){var n=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=s;n(s,i);function s(e,t){if(!(this instanceof s))return new s(e,t);i.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,n){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}n()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:167,defined:49,inherits:50,"readable-stream":59}],49:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}w(e,t)}}else if(!i){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)T(this);else b(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)T(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=U(e,t);else i=null;if(o.isNull(i)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)T(this);if(!o.isNull(i))this.emit("data",i);return i};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){_(e)});else _(e)}}function _(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(a)o=r.join("");else o=i.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r1){var r=[];for(var n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:167}],59:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./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,stream:193}],60:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:61,dup:23,wrappy:63}],61:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":62,dup:24}],62:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],63:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],64:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],65:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:167,"is-typedarray":66}],66:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return i[n.call(e)]}},{}],67:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(o,n);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:64,stream:193,"typedarray-to-buffer":65}],68:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n=r){break}r=n;i=t[a]}return i}},{}],75:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=i.digest.bind(i);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function n(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:76}],76:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[i+u+1|0]=a.charCodeAt(r+u+2);case 2:e[i+u+2|0]=a.charCodeAt(r+u+1);case 1:e[i+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[i+u+1|0]=a[r+u+2];case 2:e[i+u+2|0]=a[r+u+1];case 1:e[i+u+3|0]=a[r+u]}};var l=function(e,t,r,n,a){var s=this,o,f=a%4,u=n%4,l=n-u;var c=new Uint8Array(i.readAsArrayBuffer(s.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);s(i,e);o(i,e,r);return n};var y=function(e,r,n){c(e)(t.h8,t.h32,r,n,0)};var b=function(e,r,n,i,a){var s=n;if(a){s=g(n,i)}y(e,r,n);t.core.hash(s,t.padMaxChunkLen)};var _=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){b(e,n,i,r,false)}b(e,n,r-n,r,true);return _(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}n._core=function s(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=n[t+320>>2]|0;o=n[t+324>>2]|0;u=n[t+328>>2]|0;c=n[t+332>>2]|0;d=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(i=0;(i|0)<64;i=i+4|0){v=n[r+i>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[e+i>>2]=v}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}n[t+320>>2]=a;n[t+324>>2]=o;n[t+328>>2]=u;n[t+332>>2]=c;n[t+336>>2]=d}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],77:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function s(e){var t={};var i=e.split("magnet:?")[1];var s=i&&i.length>=0?i.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var i=n.decode(o[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:167,"thirty-two":78,uniq:80,xtend:81}],78:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":79}],79:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var s=0;var o=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;n++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)n++}f[a]=t.charCodeAt(o);a++}for(n=a;n>>r;o[s]=a;s++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:167}],80:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],81:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],82:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();this._queue.forEach(function(e){if(e.destroy)e.destroy()});if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;var t=e._queue.shift();if(typeof t==="function")t=s(t());if(!t){e.destroy();e.push(null);return}e._current=t;t.on("readable",r);t.on("end",i);t.on("error",a);t.on("close",n);function r(){e._forward()}function n(){if(!t._readableState.ended){e.destroy()}}function i(){e._current=null;t.removeListener("readable",r);t.removeListener("end",i);t.removeListener("error",a);t.removeListener("close",n);e._next()}function a(t){e.destroy(t)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:83,stream:193}],83:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],84:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=n.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:167,http:194,https:172,"object-assign":104,once:106,"unzip-response":166,url:204}],104:[function(e,t,r){"use strict";var n=Object.prototype.propertyIsEnumerable;function i(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return n.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var n;var s=i(e);for(var o=1;on._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remoteFamily="IPv4";e.remotePort=Number(t.portNumber);e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:167,debug:108,"get-browser-rtc":111,hat:112,inherits:113,"is-typedarray":114,once:116,stream:193,"typedarray-to-buffer":134}],108:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":109,dup:8}],109:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:110}],110:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],111:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],112:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],113:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],114:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],115:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],116:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40,wrappy:115}],117:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;i(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var i=r._ws;var a=function(){i.onclose=null;r.emit("close")};if(i.readyState===u.CLOSED){a()}else{try{i.onclose=a;i.close()}catch(e){a()}}i.onopen=null;i.onmessage=null;i.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=o(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:167,debug:118,inherits:121,"is-typedarray":122,stream:193,"typedarray-to-buffer":134,ws:166}],118:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":119,dup:8}],119:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:120}],120:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],121:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],122:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],123:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("torrent-discovery");var a=e("bittorrent-dht/client");var s=e("events").EventEmitter;var o=e("xtend/mutable");var f=e("inherits");var u=e("run-parallel");var l=e("re-emitter");var c=e("bittorrent-tracker/client");f(p,s);function p(e){var t=this;if(!(t instanceof p))return new p(e);s.call(t);o(t,{announce:[],dht:typeof a==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t.infoHash=null;t.infoHashHex=null;t.torrent=null;t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}p.prototype.setTorrent=function(e){var t=this;if(!t.infoHash&&n.isBuffer(e)||typeof e==="string"){t.infoHash=typeof e==="string"?new n(e,"hex"):e}else if(!t.torrent&&e&&e.infoHash){t.torrent=e;t.infoHash=typeof e.infoHash==="string"?new n(e.infoHash,"hex"):e.infoHash}else{return}t.infoHashHex=t.infoHash.toString("hex");i("setTorrent %s",t.infoHashHex);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};p.prototype.stop=function(e){var t=this;var r=[];if(t.tracker&&t.tracker!==true){t.tracker.stop();r.push(function(e){t.tracker.destroy(e)})}if(!t._externalDHT&&t.dht&&t.dht!==true){r.push(function(e){t.dht.destroy(e)})}u(r,e)};p.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new a;l(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHashHex)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};p.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHashHex,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);l(e.tracker,e,["peer","warning","error"]);e.tracker.on("update",function(t){e.emit("trackerAnnounce",t)});e.tracker.start()};p.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"),e("buffer").Buffer)},{_process:175,"bittorrent-dht/client":166,"bittorrent-tracker/client":29,buffer:167,debug:124,events:171,inherits:127,"re-emitter":97,"run-parallel":128,"xtend/mutable":133}],124:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":125,dup:8}],125:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:126}],126:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],127:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],128:[function(e,t,r){arguments[4][98][0].apply(r,arguments)},{dezalgo:129,dup:98}],129:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:130,dup:23,wrappy:132}],130:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":131,dup:24}],131:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],132:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],133:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],134:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{buffer:167,dup:65,"is-typedarray":135}],135:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],136:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var u=1e3;var l=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:u});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:137,bitfield:141,buffer:167,events:171,inherits:142,"simple-sha1":143}],137:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":138,"./lib/encode":140,dup:3}],138:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":139,buffer:167,dup:4}],139:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],140:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:167,dup:6}],141:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:167,dup:7}],142:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],143:[function(e,t,r){arguments[4][75][0].apply(r,arguments)},{dup:75,rusha:144}],144:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{dup:76}],145:[function(e,t,r){var n=e("debug")("webtorrent:append-to");var i=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var u=[".mp4",".m4v",".webm"];var l=[".m4a",".mp3"];var c=u.concat(l);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=i(r||function(){});var l;var v=s.extname(e.name).toLowerCase();var g=0;if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)y();else if(p.indexOf(v)>=0)_();else if(d.indexOf(v)>=0)w();else if(h.indexOf(v)>=0)x();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function y(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var i=u.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){n("Use `videostream` package for "+e.name);y();l.addEventListener("error",d);l.addEventListener("playing",b);o(e,l)}function c(){n("Use MediaSource API for "+e.name);y();l.addEventListener("error",h);l.addEventListener("playing",b);e.createReadStream().pipe(new a(l,{extname:v}));if(g)l.currentTime=g}function p(){n("Use Blob URL for "+e.name);y();l.addEventListener("error",k);l.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return k(e);l.src=t;if(g)l.currentTime=g})}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e);l.removeEventListener("error",d);l.removeEventListener("playing",b);c()}function h(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e);l.removeEventListener("error",h);l.removeEventListener("playing",b);p()}function y(e){if(!l){l=document.createElement(i);l.controls=true;l.autoplay=true;l.play();l.addEventListener("progress",function(){g=l.currentTime});t.appendChild(l)}}}function b(){l.removeEventListener("playing",b);r(null,l)}function _(){l=document.createElement("audio");l.controls=true;l.autoplay=true;t.appendChild(l);e.getBlobURL(function(e,t){if(e)return k(e);l.addEventListener("error",k);l.addEventListener("playing",b);l.src=t;l.play()})}function w(){e.getBlobURL(function(n,i){if(n)return k(n);l=document.createElement("img");l.src=i;l.alt=e.name;t.appendChild(l);r(null)})}function x(){e.getBlobURL(function(e,n){if(e)return k(e);l=document.createElement("iframe");l.src=n;if(v!==".pdf")l.sandbox="allow-forms allow-scripts";t.appendChild(l);r(null)})}function k(t){if(l)l.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;n(t.message);if(r)r(t)}}},{"./media-stream":147,debug:205,dezalgo:208,path:174,videostream:231}],146:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("stream");i(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var o=t.pieceLength;r.startPiece=i/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=i-r.startPiece*o}s.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,i){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}n("read %s (length %s) (err %s)",t,i.length,r&&r.message);if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],150:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:205,http:194,mime:215,pump:219,"range-parser":220,url:204}],151:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var b=16*1024;var _=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/b;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=b;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(b,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*b;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*b)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||T});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};I.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;a_){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};I.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),A);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};I.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};I.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};I.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=L(e,E);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>k)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=k)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};I.prototype.createServer=function(e){var t=this;if(typeof y==="function"){var r=new y(t,e);t._servers.push(r);return r}};I.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function L(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function B(e){return Math.random()*e|0}function C(e,t){var r=e.map(function(e,t){return t});for(var n=r.length-1;n>0;--n){var i=B(n+1);var a=r[n];r[n]=r[i];r[i]=a}r.forEach(function(r){t(e[r],r,e)})}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":149,"./server":150,"./storage":151,_process:175,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":43,debug:205,events:171,inherits:214,"parse-torrent":92,"re-emitter":97,"run-parallel":98,"torrent-discovery":123,uniq:224,ut_metadata:136,ut_pex:166}],153:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:167,dup:7}],154:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:167,defined:155,dup:48,inherits:214,"readable-stream":164}],155:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],156:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{"./_stream_readable":158,"./_stream_writable":160,_process:175,"core-util-is":161,dup:51,inherits:214}],157:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{"./_stream_transform":159,"core-util-is":161,dup:52,inherits:214}],158:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{"./_stream_duplex":156,_process:175,buffer:167,"core-util-is":161,dup:53,events:171,inherits:214,isarray:162,stream:193,"string_decoder/":163,util:166}],159:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{"./_stream_duplex":156,"core-util-is":161,dup:54,inherits:214}],160:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./_stream_duplex":156,_process:175,buffer:167,"core-util-is":161,dup:55,inherits:214,stream:193}],161:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{buffer:167,dup:56}],162:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],163:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:167,dup:58}],164:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./lib/_stream_duplex.js":156,"./lib/_stream_passthrough.js":157,"./lib/_stream_readable.js":158,"./lib/_stream_transform.js":159,"./lib/_stream_writable.js":160,dup:59,stream:193}],165:[function(e,t,r){},{}],166:[function(e,t,r){arguments[4][165][0].apply(r,arguments)},{dup:165}],167:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=_;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ue(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":168,ieee754:169,"is-array":170}],168:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],169:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],170:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],171:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],172:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:194}],173:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],174:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function T(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(_,".");var i=e.split(".");var a=U(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,b,_,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}_=B(e.charCodeAt(d++));if(_>=l||_>k((u-i)/y)){A("overflow")}i+=_*y;w=b<=s?c:b>=s+p?p:b-s;if(_k(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,b=[],_,w,x,E;e=I(e);_=e.length;t=v;r=0;a=m;for(s=0;s<_;++s){y=e[s];if(y<128){b.push(S(y))}}n=i=b.length;if(i){b.push(g)}while(n<_){for(o=u,s=0;s<_;++s){y=e[s];if(y>=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;s<_;++s){y=e[s];if(yu){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],178:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t)}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else _(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function b(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":195,_process:175,buffer:167,foreach:199,inherits:214,stream:193}],198:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],199:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString;t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r; -}},{}],203:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:167,dup:58}],204:[function(e,t,r){var n=e("punycode");r.parse=b;r.resolve=w;r.resolveObject=x;r.format=_;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function b(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var b=-1;for(var _=0;_127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,_);var R=A.slice(_+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var _=0;_0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var b=c.length;b>=0;b--){h=c[b];if(h=="."){c.splice(b,1)}else if(h===".."){c.splice(b,1);y++}else if(y){c.splice(b,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var _=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=_?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!_){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:176,querystring:179}],205:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":206,dup:8}],206:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:207}],207:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],208:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:209,dup:23,wrappy:211}],209:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":210,dup:24}],210:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],211:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],212:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:218}],213:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],214:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],215:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":212,fs:165,once:218}],220:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],221:[function(e,t,r){arguments[4][75][0].apply(r,arguments)},{dup:75,rusha:222}],222:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{dup:76}],223:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],224:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],225:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],226:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":229}],228:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>b){_++;b+=f.sample_counts[_]}k.cts=n.samples[t].dts+f.sample_offsets[_]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var b=0;if(!v){if(!g){if(t===0){b=l.fileStart}else{b=f}}else{b=l.fileStart}}else{b=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=b+m.data_offset}else{h.offset=b}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var _=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],230:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;a1e3){f("track-"+u+".mp4",l);l=null}}};var v;var g=null;var y=null;function b(t){if(t===e.length){p.flush();return}if(g&&t===v){return}if(g){g.destroy();y()}v=t;var r={start:v,end:e.length-1};g=e.createReadStream(r);function i(e){g.pause();if(h<=a){k()}var t=e.toArrayBuffer();t.fileStart=v;v+=t.byteLength;var r;try{r=p.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(c.readyState==="open"){c.endOfStream("decode")}g.destroy();y();return}b(r)}g.on("data",i);function s(){y();b(v)}g.on("end",s);function o(e){n("Stream error: %s",e.message);if(c.readyState==="open"){c.endOfStream("network")}}g.on("error",o);y=function(){g.removeListener("data",i);g.removeListener("end",s);g.removeListener("error",o);g=null;y=null}}function _(e){var t=p.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);b(t.offset);k()}function w(e,t,r){h+=t.byteLength;e.arrayBuffers.push({buffer:t,ended:r||false});x(e)}function x(e){if(e.buffer.updating||e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);e.arrayBuffers.unshift(t);setTimeout(function(){x(e)},o)}if(r){h-=t.buffer.byteLength;if(h<=s){k()}S()}}function k(){setTimeout(function(){if(g){if(g.isPaused?g.isPaused():!g._readableState.flowing){g.resume()}}})}function S(){if(c.readyState!=="open"){return}var e=Object.keys(m).every(function(e){var t=m[e];return t.ended&&!t.buffer.updating});if(e&&c.readyState==="open"){c.endOfStream()}}};function f(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:205,mp4box:230}],232:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],233:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.55.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",executable:"^1.1.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],234:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var b=e("./lib/storage");var _=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:b;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message); -t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof _)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[234])(234)}); +(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=this._parserSize){var i=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[i.slice(this._parserSize)]:[];this._parser(i.slice(0,this._parserSize))}n(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,n){var i=n?n.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+i-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,n){for(var i=0;i>3;if(e%8!==0)t++;return t}n.prototype.get=function(e){var t=e>>3;return t>e%8)};n.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};n.prototype._grow=function(e){if(this.buffer.length=31}r.formatters.j=function(e){return JSON.stringify(e)};function i(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){a=i}});e.splice(a,0,n);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":9}],9:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function a(){return r.colors[n++%r.colors.length]}function s(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var s=t-(i||t);e.diff=s;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;f++;var i=r.formatters[n];if("function"===typeof i){var a=o[f];t=i.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=n.log||r.log||console.log.bind(console);u.apply(e,o)}n.enabled=true;var s=r.enabled(e)?n:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,i,"minute")||c(e,n,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return n(e,t)}else return s};n.rack=function(e,t,r){var i=function(i){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=n(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=i;return o};var a=i.hats={};i.get=function(e){return i.hats[e]};i.set=function(e,t){i.hats[e]=t;return i};i.bits=e||128;i.base=t||16;return i}},{}],12:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],13:[function(e,t,r){var n=1;var i=65535;var a=4;var s=function(){n=n+1&i};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=n-1&i;return function(e){var f=n-o&i;if(f>t)f=t;o=n;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=i(t.addr);var n={host:r[0],port:r[1]};if(e._hostname)n.localAddress=e._hostname;var s=t.conn=u.connect(n);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var n=setTimeout(function i(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(n.unref)n.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=i(e);var n=r[0];var a=r[1];return a>0&&a<65535&&!(n==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":16,"./lib/tcp-pool":17,_process:172,"addr-to-ip-port":163,buffer:164,debug:20,dezalgo:23,events:168,inherits:27,net:163,speedometer:28}],16:[function(e,t,r){var n=e("debug")("bittorrent-swarm:peer");var i=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var n=new f(e);n.swarm=r;n.conn=new i(e,t);n.onConnect();return n};function f(e){var t=this;t.id=e;n("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;n("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var i=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(i!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}n("Peer %s got handshake %s",r.id,i);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;n("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var i=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(i)i.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":18,"bittorrent-protocol":2,debug:20}],17:[function(e,t,r){(function(r){t.exports=f;var n=e("debug")("bittorrent-swarm:tcp-pool");var i=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};n("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var n=o[e._port];if(!n)return t();n.removeSwarm(e);var i=0;for(var a in n.swarms){var s=n.swarms[a];if(s)i+=1}if(i===0)n.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}n("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;n("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=i(e);n("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;n("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var i in e.swarms){var a=e.swarms[i];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){ +t.pendingConns.splice(t.pendingConns.indexOf(e))}var n=s.createIncomingTCPPeer(e);n.wire.once("handshake",function(i,a){var s=i.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){n.swarm=o;o._addIncomingPeer(n);n.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+n.id+": destroying peer");n.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var n=t.swarms[r];if(n){t.removeSwarm(n);n._onError(e)}}}}).call(this,e("_process"))},{"./peer":16,_process:172,debug:20,dezalgo:23,net:163}],18:[function(e,t,r){(function(r){t.exports=f;var n=e("bitfield");var i=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,i){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new n(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){i("choke")});a.on("unchoke",function(){i("unchoke")});a.once("interested",function(){i("interested");a.unchoke()});a.on("uninterested",function(){i("uninterested")});a.on("bitfield",function(){i("bitfield")});a.on("request",function(e,t,r,n){i("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,n)})}f.prototype.httpRequest=function(e,t,r,n){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return n(e);if(r.statusCode<200||r.statusCode>=300){return n(new Error("Unexpected HTTP status code "+r.statusCode))}i("Got data of length %d",t.length);n(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:19,"bittorrent-protocol":2,buffer:164,debug:20,inherits:27,"simple-get":105}],19:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],20:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":21,dup:8}],21:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:22}],22:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],23:[function(e,t,r){var n=e("wrappy");t.exports=n(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function r(){var r=arguments;var n=this;if(t)i(function(){e.apply(n,r)});else e.apply(n,r)}}},{asap:24,wrappy:26}],24:[function(e,t,r){"use strict";var n=e("./raw");var i=[];var a=[];var s=n.makeRequestCallFromTimer(o);function o(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(i.length){t=i.pop()}else{t=new u}t.task=e;n(t)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);s()}}finally{this.task=null;i[i.length]=this}}},{"./raw":25}],25:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!n.length){a();i=true}n[n.length]=e}var n=[];var i=false;var a;var s=0;var o=1024;function f(){while(so){for(var t=0,r=n.length-s;t1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(n,i){if(n)return r(n);if(Array.isArray(i))i=l(i);else i=[i];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;i.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,i)})}function x(e,t){t=m(t);c.stat(e,function(r,n){if(r)return t(r);var i={length:n.size,path:e};t(null,i)})}function k(e,t,r){c.readdir(e,function(n,i){if(n&&n.code==="ENOTDIR"){t(e,r)}else if(n){r(n)}else{v(i.filter(S).filter(d.not).map(function(r){return function(n){k(o.join(e,r),t,n)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var i=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){i[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new n(i.join(""),"hex"),s)}}}function A(e,n,a){var o=n.announceList;if(!o){if(typeof n.announce==="string")o=[[n.announce]];else if(Array.isArray(n.announce)){o=n.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof n.urlList==="string")n.urlList=[n.urlList];var f={info:{name:n.name},announce:o[0][0],"announce-list":o,"creation date":Number(n.creationDate)||Date.now(),encoding:"UTF-8"};if(n.comment!==undefined)f.comment=n.comment;if(n.createdBy!==undefined)f["created by"]=n.createdBy;if(n.private!==undefined)f.info.private=Number(n.private);if(n.sslCert!==undefined)f.info["ssl-cert"]=n.sslCert;if(n.urlList!==undefined)f["url-list"]=n.urlList;var u=n.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(n.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,i.encode(f))})}function U(e,t){return e+t.length}function T(e){return typeof Blob!=="undefined"&&e instanceof Blob}function I(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,n){t.length+=e.length;this.push(e);n()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:44,"block-stream2":48,buffer:164,dezalgo:60,"filestream/read":67,flatten:68,fs:162,"is-file":69,junk:70,multistream:71,once:74,path:171,"piece-length":75,"run-parallel":100,"simple-sha1":77,stream:190}],44:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":45,"./lib/encode":47,dup:3}],45:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":46,buffer:164,dup:4}],46:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],47:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],48:[function(e,t,r){(function(r){var n=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=s;n(s,i);function s(e,t){if(!(this instanceof s))return new s(e,t);i.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,n){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}n()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:164,defined:49,inherits:50,"readable-stream":59}],49:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!i){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)T(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)T(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=U(e,t);else i=null;if(o.isNull(i)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)T(this);if(!o.isNull(i))this.emit("data",i);return i};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(a)o=r.join("");else o=i.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r1){var r=[];for(var n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:164}],59:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./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,stream:190}],60:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:61,dup:23,wrappy:63}],61:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":62,dup:24}],62:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],63:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],64:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],65:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:164,"is-typedarray":66}],66:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return i[n.call(e)]}},{}],67:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(o,n);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:64,stream:190,"typedarray-to-buffer":65}],68:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n=r){break}r=n;i=t[a]}return i}},{}],77:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=i.digest.bind(i);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function n(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:78}],78:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[i+u+1|0]=a.charCodeAt(r+u+2);case 2:e[i+u+2|0]=a.charCodeAt(r+u+1);case 1:e[i+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[i+u+1|0]=a[r+u+2];case 2:e[i+u+2|0]=a[r+u+1];case 1:e[i+u+3|0]=a[r+u]}};var l=function(e,t,r,n,a){var s=this,o,f=a%4,u=n%4,l=n-u;var c=new Uint8Array(i.readAsArrayBuffer(s.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);s(i,e);o(i,e,r);return n};var y=function(e,r,n){c(e)(t.h8,t.h32,r,n,0)};var _=function(e,r,n,i,a){var s=n;if(a){s=g(n,i)}y(e,r,n);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){_(e,n,i,r,false)}_(e,n,r-n,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}n._core=function s(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=n[t+320>>2]|0;o=n[t+324>>2]|0;u=n[t+328>>2]|0;c=n[t+332>>2]|0;d=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(i=0;(i|0)<64;i=i+4|0){v=n[r+i>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[e+i>>2]=v}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}n[t+320>>2]=a;n[t+324>>2]=o;n[t+328>>2]=u;n[t+332>>2]=c;n[t+336>>2]=d}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],79:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function s(e){var t={};var i=e.split("magnet:?")[1];var s=i&&i.length>=0?i.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var i=n.decode(o[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:164,"thirty-two":80,uniq:82,xtend:83}],80:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":81}],81:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var s=0;var o=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;n++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)n++}f[a]=t.charCodeAt(o);a++}for(n=a;n>>r;o[s]=a;s++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:164}],82:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],83:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],84:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=typeof e==="function"?e:e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();if(typeof this._queue!=="function"){this._queue.forEach(function(e){if(e.destroy)e.destroy()})}if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;var t=typeof e._queue==="function"?e._queue():e._queue.shift();if(typeof t==="function")t=s(t());if(!t){e.destroy();e.push(null);return}e._current=t;t.on("readable",r);t.on("end",i);t.on("error",a);t.on("close",n);function r(){e._forward()}function n(){if(!t._readableState.ended){e.destroy()}}function i(){e._current=null;t.removeListener("readable",r);t.removeListener("end",i);t.removeListener("error",a);t.removeListener("close",n);e._next()}function a(t){e.destroy(t)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:85,stream:190}],85:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],86:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=n.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:164,http:191,https:169,"object-assign":106,once:108,"unzip-response":163,url:201}],106:[function(e,t,r){"use strict";var n=Object.prototype.propertyIsEnumerable;function i(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return n.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var n;var s=i(e);for(var o=1;on._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:164,debug:110,"get-browser-rtc":113,hat:114,inherits:115,"is-typedarray":116,once:118,stream:190,"typedarray-to-buffer":131}],110:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":111,dup:8}],111:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:112}],112:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],113:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],114:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],115:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],116:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],117:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],118:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40,wrappy:117}],119:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;i(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var i=r._ws;var a=function(){i.onclose=null;r.emit("close")};if(i.readyState===u.CLOSED){a()}else{try{i.onclose=a;i.close()}catch(e){a()}}i.onopen=null;i.onmessage=null;i.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=o(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:164,debug:120,inherits:123,"is-typedarray":124,stream:190,"typedarray-to-buffer":131,ws:163}],120:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":121,dup:8}],121:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:122}],122:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],123:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],124:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],125:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("torrent-discovery");var a=e("bittorrent-dht/client");var s=e("events").EventEmitter;var o=e("xtend/mutable");var f=e("inherits");var u=e("run-parallel");var l=e("re-emitter");var c=e("bittorrent-tracker/client");f(p,s);function p(e){var t=this;if(!(t instanceof p))return new p(e);s.call(t);o(t,{announce:[],dht:typeof a==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t.infoHash=null;t.infoHashHex=null;t.torrent=null;t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}p.prototype.setTorrent=function(e){var t=this;if(!t.infoHash&&n.isBuffer(e)||typeof e==="string"){t.infoHash=typeof e==="string"?new n(e,"hex"):e}else if(!t.torrent&&e&&e.infoHash){t.torrent=e;t.infoHash=typeof e.infoHash==="string"?new n(e.infoHash,"hex"):e.infoHash}else{return}t.infoHashHex=t.infoHash.toString("hex");i("setTorrent %s",t.infoHashHex);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};p.prototype.stop=function(e){var t=this;var r=[];if(t.tracker&&t.tracker!==true){t.tracker.stop();r.push(function(e){t.tracker.destroy(e)})}if(!t._externalDHT&&t.dht&&t.dht!==true){r.push(function(e){t.dht.destroy(e)})}u(r,e)};p.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new a;l(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHashHex)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};p.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHashHex,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);l(e.tracker,e,["peer","warning","error"]);e.tracker.on("update",function(t){e.emit("trackerAnnounce",t)});e.tracker.start()};p.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"),e("buffer").Buffer)},{_process:172,"bittorrent-dht/client":163,"bittorrent-tracker/client":29,buffer:164,debug:126,events:168,inherits:129,"re-emitter":99,"run-parallel":100,"xtend/mutable":130}],126:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":127,dup:8}],127:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:128}],128:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],129:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],130:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],131:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{buffer:164,dup:65,"is-typedarray":132}],132:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],133:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var u=1e3;var l=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:u});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:134,bitfield:138,buffer:164,events:168,inherits:139,"simple-sha1":140}],134:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":135,"./lib/encode":137,dup:3}],135:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":136,buffer:164,dup:4}],136:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],137:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],138:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],139:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],140:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:141}],141:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],142:[function(e,t,r){var n=e("debug")("webtorrent:append-to");var i=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var u=[".mp4",".m4v",".webm"];var l=[".m4a",".mp3"];var c=u.concat(l);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=i(r||function(){});var l;var v=s.extname(e.name).toLowerCase();var g=0;if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)y();else if(p.indexOf(v)>=0)b();else if(d.indexOf(v)>=0)w();else if(h.indexOf(v)>=0)x();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function y(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var i=u.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){n("Use `videostream` package for "+e.name);y();l.addEventListener("error",d);l.addEventListener("playing",_);o(e,l)}function c(){n("Use MediaSource API for "+e.name);y();l.addEventListener("error",h);l.addEventListener("playing",_);e.createReadStream().pipe(new a(l,{extname:v}));if(g)l.currentTime=g}function p(){n("Use Blob URL for "+e.name);y();l.addEventListener("error",k);l.addEventListener("playing",_);e.getBlobURL(function(e,t){if(e)return k(e);l.src=t;if(g)l.currentTime=g})}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e);l.removeEventListener("error",d);l.removeEventListener("playing",_);c()}function h(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e);l.removeEventListener("error",h);l.removeEventListener("playing",_);p()}function y(e){if(!l){l=document.createElement(i);l.controls=true;l.autoplay=true;l.play();l.addEventListener("progress",function(){g=l.currentTime});t.appendChild(l)}}}function _(){l.removeEventListener("playing",_);r(null,l)}function b(){l=document.createElement("audio");l.controls=true;l.autoplay=true;t.appendChild(l);e.getBlobURL(function(e,t){if(e)return k(e);l.addEventListener("error",k);l.addEventListener("playing",_);l.src=t;l.play()})}function w(){e.getBlobURL(function(n,i){if(n)return k(n);l=document.createElement("img");l.src=i;l.alt=e.name;t.appendChild(l);r(null)})}function x(){e.getBlobURL(function(e,n){if(e)return k(e);l=document.createElement("iframe");l.src=n;if(v!==".pdf")l.sandbox="allow-forms allow-scripts";t.appendChild(l);r(null)})}function k(t){if(l)l.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;n(t.message);if(r)r(t)}}},{"./media-stream":144,debug:202,dezalgo:205,path:171,videostream:229}],143:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("stream");i(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var o=t.pieceLength;r.startPiece=i/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=i-r.startPiece*o}s.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,i){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}n("read %s (length %s) (err %s)",t,i.length,r&&r.message);if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],147:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:202,http:191,mime:212,pump:216,"range-parser":218,url:201}],148:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var _=16*1024;var b=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/_;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=_;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(_,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*_;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*_)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||I});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};L.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;aw){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};L.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),U);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};L.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};L.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};L.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=B(e,A);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>S)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=S)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};L.prototype.createServer=function(e){var t=this;if(typeof _==="function"){var r=new _(t,e);t._servers.push(r);return r}};L.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function B(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function C(e){return Math.random()*e|0}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":146,"./server":147,"./storage":148,_process:172,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":43,debug:202,events:168,inherits:211,"parse-torrent":94,"random-iterate":217,"re-emitter":99,"run-parallel":100,"torrent-discovery":125,uniq:222,ut_metadata:133,ut_pex:163}],150:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],151:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:164,defined:152,dup:48,inherits:211,"readable-stream":161}],152:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],153:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{"./_stream_readable":155,"./_stream_writable":157,_process:172,"core-util-is":158,dup:51,inherits:211}],154:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{"./_stream_transform":156,"core-util-is":158,dup:52,inherits:211}],155:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:53,events:168,inherits:211,isarray:159,stream:190,"string_decoder/":160,util:163}],156:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{"./_stream_duplex":153,"core-util-is":158,dup:54,inherits:211}],157:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:55,inherits:211,stream:190}],158:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{buffer:164,dup:56}],159:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],160:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],161:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./lib/_stream_duplex.js":153,"./lib/_stream_passthrough.js":154,"./lib/_stream_readable.js":155,"./lib/_stream_transform.js":156,"./lib/_stream_writable.js":157,dup:59,stream:190}],162:[function(e,t,r){},{}],163:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],164:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=_;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function _(e,t){if(!(this instanceof _))return new _(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=b;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ue(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":165,ieee754:166,"is-array":167}],165:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],166:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],167:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],168:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],169:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:191}],170:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],171:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function T(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(b,".");var i=e.split(".");var a=U(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-i)/y)){A("overflow")}i+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,_=[],b,w,x,E;e=I(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],175:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t)}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":192,_process:172,buffer:164,foreach:196,inherits:211,stream:190}],195:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],196:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString;t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r}},{}],200:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],201:[function(e,t,r){var n=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:173,querystring:176}],202:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":203,dup:8}],203:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:204}],204:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],205:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:206,dup:23,wrappy:208}],206:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":207,dup:24}],207:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],208:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],209:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:215}],210:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],211:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],212:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":209,fs:162,once:215}],217:[function(e,t,r){var n=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var n=Math.random()*r|0;var i=e[t+n];var a=e[t];e[t]=i;e[t+n]=a;t++;return i}};t.exports=n},{}],218:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],219:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:220}],220:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],221:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],222:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],223:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],224:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"] +}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":227}],226:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=n.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],228:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;ai){break}else if(o>=0||i<=l){o=l}}var c=o-i;if(c<0)c=0;n("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new i;m.onError=function(e){n("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){n("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var n={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,n));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=n}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,n){var i=g[e];S(i,r,n===i.meta.nb_samples);if(e===f&&u){u.push(r);if(n>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var i={start:y,end:e.length-1};_=e.createReadStream(i);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){n("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:202,mp4box:228}],230:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],231:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.55.1",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",executable:"^1.1.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git" +},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],232:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var _=e("./lib/storage");var b=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:_;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[232])(232)}); From 2da893db5a914b8ed1cfc3468bba235539ac41a8 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 17:01:47 +0200 Subject: [PATCH 018/109] add torrent.numPeers --- lib/torrent.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/torrent.js b/lib/torrent.js index 034ebc9a..cb7e130b 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -147,6 +147,12 @@ Object.defineProperty(Torrent.prototype, 'torrentFileURL', { } }) +Object.defineProperty(Torrent.prototype, 'numPeers', { + get: function () { + return this.swarm ? this.swarm.numPeers : 0 + } +}) + Torrent.prototype._onTorrentId = function (torrentId) { var self = this if (self.destroyed) return From e15884443855bcce31c61a8b81142681a8700861 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 17:02:01 +0200 Subject: [PATCH 019/109] add torrent.downloadSpeed/uploadSpeed --- lib/torrent.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/torrent.js b/lib/torrent.js index cb7e130b..12fd1501 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -153,6 +153,14 @@ Object.defineProperty(Torrent.prototype, 'numPeers', { } }) +Torrent.prototype.downloadSpeed = function () { + return this.swarm ? this.swarm.downloadSpeed() : 0 +} + +Torrent.prototype.uploadSpeed = function () { + return this.swarm ? this.swarm.uploadSpeed() : 0 +} + Torrent.prototype._onTorrentId = function (torrentId) { var self = this if (self.destroyed) return From aeb9ed4bed158ab335abd9a3efa1a596089f1b7e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 17:02:17 +0200 Subject: [PATCH 020/109] add client/torrent.on('download/upload') --- lib/torrent.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index 12fd1501..4149faf1 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -216,9 +216,17 @@ Torrent.prototype._onParsedTorrent = function (parsedTorrent) { self.swarm.on('error', self._onError.bind(self)) self.swarm.on('wire', self._onWire.bind(self)) - // update overall client stats - self.swarm.on('download', self.client.downloadSpeed.bind(self.client)) - self.swarm.on('upload', self.client.uploadSpeed.bind(self.client)) + self.swarm.on('download', function (downloaded) { + self.client.downloadSpeed(downloaded) // update overall client stats + self.client.emit('download', downloaded) + self.emit('download', downloaded) + }) + + self.swarm.on('upload', function (uploaded) { + self.client.uploadSpeed(uploaded) // update overall client stats + self.client.emit('upload', uploaded) + self.emit('upload', uploaded) + }) // listen for peers (note: in the browser, this is a no-op and callback is called on // next tick) From afa1233cab47b12186b6671da4909ad15434458a Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 17:02:29 +0200 Subject: [PATCH 021/109] cmd: use torrent.timeRemaining --- bin/cmd.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index a3eaebf3..31bde0b3 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -487,10 +487,8 @@ function drawTorrent (torrent) { }) var linesRemaining = clivas.height var peerslisted = 0 - var speed = torrent.swarm.downloadSpeed() - var estimatedSecondsRemaining = - Math.max(0, torrent.length - torrent.swarm.downloaded) / (speed > 0 ? speed : -1) - var estimate = moment.duration(estimatedSecondsRemaining, 'seconds').humanize() + var speed = torrent.downloadSpeed() + var estimate = moment.duration(torrent.timeRemaining / 1000, 'seconds').humanize() clivas.clear() From d4e5daf546560f32f39db9629974859c5ad7dad3 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 17:05:00 +0200 Subject: [PATCH 022/109] 0.56.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f85d2ce..5786a569 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.55.1", + "version": "0.56.0", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From 90fbfd16a902b617095d411e57a6deed19588b04 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Aug 2015 17:14:53 +0200 Subject: [PATCH 023/109] build --- webtorrent.min.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index ce6505f3..088900c7 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -2,11 +2,11 @@ t.pendingConns.splice(t.pendingConns.indexOf(e))}var n=s.createIncomingTCPPeer(e);n.wire.once("handshake",function(i,a){var s=i.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){n.swarm=o;o._addIncomingPeer(n);n.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+n.id+": destroying peer");n.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var n=t.swarms[r];if(n){t.removeSwarm(n);n._onError(e)}}}}).call(this,e("_process"))},{"./peer":16,_process:172,debug:20,dezalgo:23,net:163}],18:[function(e,t,r){(function(r){t.exports=f;var n=e("bitfield");var i=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,i){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new n(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){i("choke")});a.on("unchoke",function(){i("unchoke")});a.once("interested",function(){i("interested");a.unchoke()});a.on("uninterested",function(){i("uninterested")});a.on("bitfield",function(){i("bitfield")});a.on("request",function(e,t,r,n){i("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,n)})}f.prototype.httpRequest=function(e,t,r,n){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return n(e);if(r.statusCode<200||r.statusCode>=300){return n(new Error("Unexpected HTTP status code "+r.statusCode))}i("Got data of length %d",t.length);n(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:19,"bittorrent-protocol":2,buffer:164,debug:20,inherits:27,"simple-get":105}],19:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],20:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":21,dup:8}],21:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:22}],22:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],23:[function(e,t,r){var n=e("wrappy");t.exports=n(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function r(){var r=arguments;var n=this;if(t)i(function(){e.apply(n,r)});else e.apply(n,r)}}},{asap:24,wrappy:26}],24:[function(e,t,r){"use strict";var n=e("./raw");var i=[];var a=[];var s=n.makeRequestCallFromTimer(o);function o(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(i.length){t=i.pop()}else{t=new u}t.task=e;n(t)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);s()}}finally{this.task=null;i[i.length]=this}}},{"./raw":25}],25:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!n.length){a();i=true}n[n.length]=e}var n=[];var i=false;var a;var s=0;var o=1024;function f(){while(so){for(var t=0,r=n.length-s;t1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(n,i){if(n)return r(n);if(Array.isArray(i))i=l(i);else i=[i];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;i.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,i)})}function x(e,t){t=m(t);c.stat(e,function(r,n){if(r)return t(r);var i={length:n.size,path:e};t(null,i)})}function k(e,t,r){c.readdir(e,function(n,i){if(n&&n.code==="ENOTDIR"){t(e,r)}else if(n){r(n)}else{v(i.filter(S).filter(d.not).map(function(r){return function(n){k(o.join(e,r),t,n)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var i=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){i[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new n(i.join(""),"hex"),s)}}}function A(e,n,a){var o=n.announceList;if(!o){if(typeof n.announce==="string")o=[[n.announce]];else if(Array.isArray(n.announce)){o=n.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof n.urlList==="string")n.urlList=[n.urlList];var f={info:{name:n.name},announce:o[0][0],"announce-list":o,"creation date":Number(n.creationDate)||Date.now(),encoding:"UTF-8"};if(n.comment!==undefined)f.comment=n.comment;if(n.createdBy!==undefined)f["created by"]=n.createdBy;if(n.private!==undefined)f.info.private=Number(n.private);if(n.sslCert!==undefined)f.info["ssl-cert"]=n.sslCert;if(n.urlList!==undefined)f["url-list"]=n.urlList;var u=n.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(n.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,i.encode(f))})}function U(e,t){return e+t.length}function T(e){return typeof Blob!=="undefined"&&e instanceof Blob}function I(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,n){t.length+=e.length;this.push(e);n()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:44,"block-stream2":48,buffer:164,dezalgo:60,"filestream/read":67,flatten:68,fs:162,"is-file":69,junk:70,multistream:71,once:74,path:171,"piece-length":75,"run-parallel":100,"simple-sha1":77,stream:190}],44:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":45,"./lib/encode":47,dup:3}],45:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":46,buffer:164,dup:4}],46:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],47:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],48:[function(e,t,r){(function(r){var n=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=s;n(s,i);function s(e,t){if(!(this instanceof s))return new s(e,t);i.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,n){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}n()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:164,defined:49,inherits:50,"readable-stream":59}],49:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!i){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)T(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)T(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=U(e,t);else i=null;if(o.isNull(i)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)T(this);if(!o.isNull(i))this.emit("data",i);return i};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(a)o=r.join("");else o=i.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r1){var r=[];for(var n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:164}],59:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./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,stream:190}],60:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:61,dup:23,wrappy:63}],61:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":62,dup:24}],62:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],63:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],64:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],65:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:164,"is-typedarray":66}],66:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return i[n.call(e)]}},{}],67:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(o,n);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:64,stream:190,"typedarray-to-buffer":65}],68:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n=r){break}r=n;i=t[a]}return i}},{}],77:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=i.digest.bind(i);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function n(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:78}],78:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[i+u+1|0]=a.charCodeAt(r+u+2);case 2:e[i+u+2|0]=a.charCodeAt(r+u+1);case 1:e[i+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[i+u+1|0]=a[r+u+2];case 2:e[i+u+2|0]=a[r+u+1];case 1:e[i+u+3|0]=a[r+u]}};var l=function(e,t,r,n,a){var s=this,o,f=a%4,u=n%4,l=n-u;var c=new Uint8Array(i.readAsArrayBuffer(s.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);s(i,e);o(i,e,r);return n};var y=function(e,r,n){c(e)(t.h8,t.h32,r,n,0)};var _=function(e,r,n,i,a){var s=n;if(a){s=g(n,i)}y(e,r,n);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){_(e,n,i,r,false)}_(e,n,r-n,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}n._core=function s(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=n[t+320>>2]|0;o=n[t+324>>2]|0;u=n[t+328>>2]|0;c=n[t+332>>2]|0;d=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(i=0;(i|0)<64;i=i+4|0){v=n[r+i>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[e+i>>2]=v}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}n[t+320>>2]=a;n[t+324>>2]=o;n[t+328>>2]=u;n[t+332>>2]=c;n[t+336>>2]=d}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],79:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function s(e){var t={};var i=e.split("magnet:?")[1];var s=i&&i.length>=0?i.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var i=n.decode(o[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:164,"thirty-two":80,uniq:82,xtend:83}],80:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":81}],81:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var s=0;var o=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;n++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)n++}f[a]=t.charCodeAt(o);a++}for(n=a;n>>r;o[s]=a;s++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:164}],82:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],83:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],84:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=typeof e==="function"?e:e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();if(typeof this._queue!=="function"){this._queue.forEach(function(e){if(e.destroy)e.destroy()})}if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;var t=typeof e._queue==="function"?e._queue():e._queue.shift();if(typeof t==="function")t=s(t());if(!t){e.destroy();e.push(null);return}e._current=t;t.on("readable",r);t.on("end",i);t.on("error",a);t.on("close",n);function r(){e._forward()}function n(){if(!t._readableState.ended){e.destroy()}}function i(){e._current=null;t.removeListener("readable",r);t.removeListener("end",i);t.removeListener("error",a);t.removeListener("close",n);e._next()}function a(t){e.destroy(t)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:85,stream:190}],85:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],86:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=n.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:164,http:191,https:169,"object-assign":106,once:108,"unzip-response":163,url:201}],106:[function(e,t,r){"use strict";var n=Object.prototype.propertyIsEnumerable;function i(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return n.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var n;var s=i(e);for(var o=1;on._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:164,debug:110,"get-browser-rtc":113,hat:114,inherits:115,"is-typedarray":116,once:118,stream:190,"typedarray-to-buffer":131}],110:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":111,dup:8}],111:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:112}],112:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],113:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],114:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],115:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],116:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],117:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],118:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40,wrappy:117}],119:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;i(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var i=r._ws;var a=function(){i.onclose=null;r.emit("close")};if(i.readyState===u.CLOSED){a()}else{try{i.onclose=a;i.close()}catch(e){a()}}i.onopen=null;i.onmessage=null;i.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=o(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:164,debug:120,inherits:123,"is-typedarray":124,stream:190,"typedarray-to-buffer":131,ws:163}],120:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":121,dup:8}],121:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:122}],122:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],123:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],124:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],125:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("torrent-discovery");var a=e("bittorrent-dht/client");var s=e("events").EventEmitter;var o=e("xtend/mutable");var f=e("inherits");var u=e("run-parallel");var l=e("re-emitter");var c=e("bittorrent-tracker/client");f(p,s);function p(e){var t=this;if(!(t instanceof p))return new p(e);s.call(t);o(t,{announce:[],dht:typeof a==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t.infoHash=null;t.infoHashHex=null;t.torrent=null;t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}p.prototype.setTorrent=function(e){var t=this;if(!t.infoHash&&n.isBuffer(e)||typeof e==="string"){t.infoHash=typeof e==="string"?new n(e,"hex"):e}else if(!t.torrent&&e&&e.infoHash){t.torrent=e;t.infoHash=typeof e.infoHash==="string"?new n(e.infoHash,"hex"):e.infoHash}else{return}t.infoHashHex=t.infoHash.toString("hex");i("setTorrent %s",t.infoHashHex);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};p.prototype.stop=function(e){var t=this;var r=[];if(t.tracker&&t.tracker!==true){t.tracker.stop();r.push(function(e){t.tracker.destroy(e)})}if(!t._externalDHT&&t.dht&&t.dht!==true){r.push(function(e){t.dht.destroy(e)})}u(r,e)};p.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new a;l(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHashHex)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};p.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHashHex,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);l(e.tracker,e,["peer","warning","error"]);e.tracker.on("update",function(t){e.emit("trackerAnnounce",t)});e.tracker.start()};p.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"),e("buffer").Buffer)},{_process:172,"bittorrent-dht/client":163,"bittorrent-tracker/client":29,buffer:164,debug:126,events:168,inherits:129,"re-emitter":99,"run-parallel":100,"xtend/mutable":130}],126:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":127,dup:8}],127:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:128}],128:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],129:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],130:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],131:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{buffer:164,dup:65,"is-typedarray":132}],132:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],133:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var u=1e3;var l=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:u});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:134,bitfield:138,buffer:164,events:168,inherits:139,"simple-sha1":140}],134:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":135,"./lib/encode":137,dup:3}],135:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":136,buffer:164,dup:4}],136:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],137:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],138:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],139:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],140:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:141}],141:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],142:[function(e,t,r){var n=e("debug")("webtorrent:append-to");var i=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var u=[".mp4",".m4v",".webm"];var l=[".m4a",".mp3"];var c=u.concat(l);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=i(r||function(){});var l;var v=s.extname(e.name).toLowerCase();var g=0;if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)y();else if(p.indexOf(v)>=0)b();else if(d.indexOf(v)>=0)w();else if(h.indexOf(v)>=0)x();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function y(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var i=u.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){n("Use `videostream` package for "+e.name);y();l.addEventListener("error",d);l.addEventListener("playing",_);o(e,l)}function c(){n("Use MediaSource API for "+e.name);y();l.addEventListener("error",h);l.addEventListener("playing",_);e.createReadStream().pipe(new a(l,{extname:v}));if(g)l.currentTime=g}function p(){n("Use Blob URL for "+e.name);y();l.addEventListener("error",k);l.addEventListener("playing",_);e.getBlobURL(function(e,t){if(e)return k(e);l.src=t;if(g)l.currentTime=g})}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e);l.removeEventListener("error",d);l.removeEventListener("playing",_);c()}function h(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e);l.removeEventListener("error",h);l.removeEventListener("playing",_);p()}function y(e){if(!l){l=document.createElement(i);l.controls=true;l.autoplay=true;l.play();l.addEventListener("progress",function(){g=l.currentTime});t.appendChild(l)}}}function _(){l.removeEventListener("playing",_);r(null,l)}function b(){l=document.createElement("audio");l.controls=true;l.autoplay=true;t.appendChild(l);e.getBlobURL(function(e,t){if(e)return k(e);l.addEventListener("error",k);l.addEventListener("playing",_);l.src=t;l.play()})}function w(){e.getBlobURL(function(n,i){if(n)return k(n);l=document.createElement("img");l.src=i;l.alt=e.name;t.appendChild(l);r(null)})}function x(){e.getBlobURL(function(e,n){if(e)return k(e);l=document.createElement("iframe");l.src=n;if(v!==".pdf")l.sandbox="allow-forms allow-scripts";t.appendChild(l);r(null)})}function k(t){if(l)l.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;n(t.message);if(r)r(t)}}},{"./media-stream":144,debug:202,dezalgo:205,path:171,videostream:229}],143:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("stream");i(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var o=t.pieceLength;r.startPiece=i/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=i-r.startPiece*o}s.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,i){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}n("read %s (length %s) (err %s)",t,i.length,r&&r.message);if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],147:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:202,http:191,mime:212,pump:216,"range-parser":218,url:201}],148:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var _=16*1024;var b=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/_;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=_;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(_,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*_;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*_)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||I});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};L.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;aw){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};L.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),U);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};L.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};L.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};L.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=B(e,A);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>S)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=S)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};L.prototype.createServer=function(e){var t=this;if(typeof _==="function"){var r=new _(t,e);t._servers.push(r);return r}};L.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function B(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function C(e){return Math.random()*e|0}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":146,"./server":147,"./storage":148,_process:172,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":43,debug:202,events:168,inherits:211,"parse-torrent":94,"random-iterate":217,"re-emitter":99,"run-parallel":100,"torrent-discovery":125,uniq:222,ut_metadata:133,ut_pex:163}],150:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],151:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:164,defined:152,dup:48,inherits:211,"readable-stream":161}],152:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],153:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{"./_stream_readable":155,"./_stream_writable":157,_process:172,"core-util-is":158,dup:51,inherits:211}],154:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{"./_stream_transform":156,"core-util-is":158,dup:52,inherits:211}],155:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:53,events:168,inherits:211,isarray:159,stream:190,"string_decoder/":160,util:163}],156:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{"./_stream_duplex":153,"core-util-is":158,dup:54,inherits:211}],157:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:55,inherits:211,stream:190}],158:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{buffer:164,dup:56}],159:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],160:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],161:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./lib/_stream_duplex.js":153,"./lib/_stream_passthrough.js":154,"./lib/_stream_readable.js":155,"./lib/_stream_transform.js":156,"./lib/_stream_writable.js":157,dup:59,stream:190}],162:[function(e,t,r){},{}],163:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],164:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=_;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function _(e,t){if(!(this instanceof _))return new _(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=b;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ue(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":165,ieee754:166,"is-array":167}],165:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],166:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],167:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],168:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],169:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:191}],170:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],171:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function T(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(b,".");var i=e.split(".");var a=U(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-i)/y)){A("overflow")}i+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,_=[],b,w,x,E;e=I(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],175:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t)}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":192,_process:172,buffer:164,foreach:196,inherits:211,stream:190}],195:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],196:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString;t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r}},{}],200:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],201:[function(e,t,r){var n=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:173,querystring:176}],202:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":203,dup:8}],203:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:204}],204:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],205:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:206,dup:23,wrappy:208}],206:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":207,dup:24}],207:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],208:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],209:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:215}],210:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],211:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],212:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":209,fs:162,once:215}],217:[function(e,t,r){var n=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var n=Math.random()*r|0;var i=e[t+n];var a=e[t];e[t]=i;e[t+n]=a;t++;return i}};t.exports=n},{}],218:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],219:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:220}],220:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],221:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],222:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],223:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],224:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"] -}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":227}],226:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=n.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],228:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;ai){break}else if(o>=0||i<=l){o=l}}var c=o-i;if(c<0)c=0;n("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new i;m.onError=function(e){n("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){n("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var n={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,n));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=n}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,n){var i=g[e];S(i,r,n===i.meta.nb_samples);if(e===f&&u){u.push(r);if(n>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var i={start:y,end:e.length-1};_=e.createReadStream(i);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){n("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:202,mp4box:228}],230:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],231:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.55.1",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",executable:"^1.1.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git" -},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],232:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var _=e("./lib/storage");var b=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:_;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[232])(232)}); +r._mediaSource.addEventListener("sourceopen",function(){if(s.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){n("finish");r._mediaSource.endOfStream()});window.vs=r}o.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);n("appendBuffer %s",e.length);i._cb=r};o.prototype._flow=function(){var e=this;n("flow");if(e._cb){e._cb(null)}};function f(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{debug:202,inherits:211,stream:190}],145:[function(e,t,r){t.exports={".aac":"audio/aac",".css":"text/css",".html":"text/html",".js":"application/javascript",".m4a":"audio/mp4",".md":"text/x-markdown",".mp3":"audio/mpeg",".mp4":"video/mp4",".oga":"audio/ogg",".ogg":"audio/ogg",".pdf":"application/pdf",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm"}},{}],146:[function(e,t,r){t.exports=n;function n(e,t){var r=this;r.pieces=[];r.swarm=e;r.numPieces=t;function n(e){e.on("have",function(e){r.pieces[e]+=1});e.on("bitfield",function(){r.recalculate()});e.on("close",function(){for(var t=0;t0){return r[Math.random()*r.length|0]}else{return-1}}},{}],147:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:202,http:191,mime:212,pump:216,"range-parser":218,url:201}],148:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var _=16*1024;var b=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/_;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=_;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(_,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*_;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*_)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||I});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};L.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;aw){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};L.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),U);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};L.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};L.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};L.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=B(e,A);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>S)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=S)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};L.prototype.createServer=function(e){var t=this;if(typeof _==="function"){var r=new _(t,e);t._servers.push(r);return r}};L.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function B(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function C(e){return Math.random()*e|0}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":146,"./server":147,"./storage":148,_process:172,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":43,debug:202,events:168,inherits:211,"parse-torrent":94,"random-iterate":217,"re-emitter":99,"run-parallel":100,"torrent-discovery":125,uniq:222,ut_metadata:133,ut_pex:163}],150:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],151:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:164,defined:152,dup:48,inherits:211,"readable-stream":161}],152:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],153:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{"./_stream_readable":155,"./_stream_writable":157,_process:172,"core-util-is":158,dup:51,inherits:211}],154:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{"./_stream_transform":156,"core-util-is":158,dup:52,inherits:211}],155:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:53,events:168,inherits:211,isarray:159,stream:190,"string_decoder/":160,util:163}],156:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{"./_stream_duplex":153,"core-util-is":158,dup:54,inherits:211}],157:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:55,inherits:211,stream:190}],158:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{buffer:164,dup:56}],159:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],160:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],161:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./lib/_stream_duplex.js":153,"./lib/_stream_passthrough.js":154,"./lib/_stream_readable.js":155,"./lib/_stream_transform.js":156,"./lib/_stream_writable.js":157,dup:59,stream:190}],162:[function(e,t,r){},{}],163:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],164:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=_;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8"); +}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function _(e,t){if(!(this instanceof _))return new _(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=b;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ue(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":165,ieee754:166,"is-array":167}],165:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],166:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],167:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],168:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],169:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:191}],170:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],171:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function T(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(b,".");var i=e.split(".");var a=U(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-i)/y)){A("overflow")}i+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,_=[],b,w,x,E;e=I(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],175:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t)}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"; +};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":192,_process:172,buffer:164,foreach:196,inherits:211,stream:190}],195:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],196:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString;t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r}},{}],200:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],201:[function(e,t,r){var n=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:173,querystring:176}],202:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":203,dup:8}],203:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:204}],204:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],205:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:206,dup:23,wrappy:208}],206:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":207,dup:24}],207:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],208:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],209:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:215}],210:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],211:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],212:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":209,fs:162,once:215}],217:[function(e,t,r){var n=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var n=Math.random()*r|0;var i=e[t+n];var a=e[t];e[t]=i;e[t+n]=a;t++;return i}};t.exports=n},{}],218:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],219:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:220}],220:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],221:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],222:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],223:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],224:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"] +},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":227}],226:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=n.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],228:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;ai){break}else if(o>=0||i<=l){o=l}}var c=o-i;if(c<0)c=0;n("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new i;m.onError=function(e){n("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){n("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var n={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,n));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=n}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,n){var i=g[e];S(i,r,n===i.meta.nb_samples);if(e===f&&u){u.push(r);if(n>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var i={start:y,end:e.length-1};_=e.createReadStream(i);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){n("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:202,mp4box:228}],230:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],231:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.56.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",executable:"^1.1.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0", +standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],232:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var _=e("./lib/storage");var b=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:_;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[232])(232)}); From c8e44d36f06a062540e5d6d4ea1e86eb97f67ad3 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Wed, 12 Aug 2015 01:55:40 +0200 Subject: [PATCH 024/109] Default download destination should be current directory, fixes #390 --- bin/cmd.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/cmd.js b/bin/cmd.js index 31bde0b3..37ae3945 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -193,7 +193,7 @@ Options (streaming): --stdout standard out (implies --quiet) Options (simple): - -o, --out [path] set download destination [default: /tmp/webtorrent] + -o, --out [path] set download destination [default: current directory] -s, --select select individual file in torrent (by index) -i, --index [number] stream a particular file from torrent (by index) -v, --version print the current version @@ -254,6 +254,11 @@ function runCreate (input) { var client, href, playerName, server, serving function runDownload (torrentId) { + + if (!argv.out && !playerName) { + argv.out = process.cwd() + } + client = new WebTorrent({ blocklist: argv.blocklist }) From 55f2307991812bec66190d04ab19e4ce3bae6293 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Wed, 12 Aug 2015 02:08:39 +0200 Subject: [PATCH 025/109] Use temp folder when streaming to stdout. --- bin/cmd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cmd.js b/bin/cmd.js index 37ae3945..0160b5c1 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -255,7 +255,7 @@ var client, href, playerName, server, serving function runDownload (torrentId) { - if (!argv.out && !playerName) { + if (!argv.out && !argv.stdout && !playerName) { argv.out = process.cwd() } From 2534f48e09bb851e8bd58fdea711209bdeac658d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 12 Aug 2015 12:48:18 +0200 Subject: [PATCH 026/109] update readme --- README.md | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/README.md b/README.md index bc22fd57..9e7d348a 100644 --- a/README.md +++ b/README.md @@ -150,28 +150,6 @@ dragDrop('body', function (files) { }) ``` -##### Streaming to an HTML5 video element? Also simple! - -```js -var WebTorrent = require('webtorrent') - -var client = new WebTorrent() -var magnetUri = '...' - -client.add(magnetUri, function (torrent) { - // Got torrent metadata! - console.log('Torrent info hash:', torrent.infoHash) - - // Let's say the first file is a webm (vp8) or mp4 (h264) video... - var file = torrent.files[0] - - // Stream the video! - // Specify a container element (CSS selector or reference to DOM node) - file.appendTo('body') - }) -}) -``` - There are more examples in the [examples](https://github.com/feross/webtorrent/tree/master/examples) folder. ##### Browserify From c5c325cb8d7687f41e5a1aeb95409238f6c9f72c Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 12 Aug 2015 13:32:07 +0200 Subject: [PATCH 027/109] 0.57.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5786a569..ad48ea6a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.56.0", + "version": "0.57.0", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From 2571fc3bebba007819c47fe3ce143f947c35e3c5 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 12 Aug 2015 13:32:26 +0200 Subject: [PATCH 028/109] build --- webtorrent.min.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 088900c7..09735d86 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,12 +1,12 @@ (function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=this._parserSize){var i=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[i.slice(this._parserSize)]:[];this._parser(i.slice(0,this._parserSize))}n(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,n){var i=n?n.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+i-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,n){for(var i=0;i>3;if(e%8!==0)t++;return t}n.prototype.get=function(e){var t=e>>3;return t>e%8)};n.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};n.prototype._grow=function(e){if(this.buffer.length=31}r.formatters.j=function(e){return JSON.stringify(e)};function i(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){a=i}});e.splice(a,0,n);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":9}],9:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function a(){return r.colors[n++%r.colors.length]}function s(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var s=t-(i||t);e.diff=s;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;f++;var i=r.formatters[n];if("function"===typeof i){var a=o[f];t=i.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=n.log||r.log||console.log.bind(console);u.apply(e,o)}n.enabled=true;var s=r.enabled(e)?n:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,i,"minute")||c(e,n,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return n(e,t)}else return s};n.rack=function(e,t,r){var i=function(i){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=n(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=i;return o};var a=i.hats={};i.get=function(e){return i.hats[e]};i.set=function(e,t){i.hats[e]=t;return i};i.bits=e||128;i.base=t||16;return i}},{}],12:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],13:[function(e,t,r){var n=1;var i=65535;var a=4;var s=function(){n=n+1&i};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=n-1&i;return function(e){var f=n-o&i;if(f>t)f=t;o=n;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=i(t.addr);var n={host:r[0],port:r[1]};if(e._hostname)n.localAddress=e._hostname;var s=t.conn=u.connect(n);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var n=setTimeout(function i(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(n.unref)n.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=i(e);var n=r[0];var a=r[1];return a>0&&a<65535&&!(n==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":16,"./lib/tcp-pool":17,_process:172,"addr-to-ip-port":163,buffer:164,debug:20,dezalgo:23,events:168,inherits:27,net:163,speedometer:28}],16:[function(e,t,r){var n=e("debug")("bittorrent-swarm:peer");var i=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var n=new f(e);n.swarm=r;n.conn=new i(e,t);n.onConnect();return n};function f(e){var t=this;t.id=e;n("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;n("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var i=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(i!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}n("Peer %s got handshake %s",r.id,i);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;n("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var i=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(i)i.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":18,"bittorrent-protocol":2,debug:20}],17:[function(e,t,r){(function(r){t.exports=f;var n=e("debug")("bittorrent-swarm:tcp-pool");var i=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};n("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var n=o[e._port];if(!n)return t();n.removeSwarm(e);var i=0;for(var a in n.swarms){var s=n.swarms[a];if(s)i+=1}if(i===0)n.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}n("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;n("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=i(e);n("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;n("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var i in e.swarms){var a=e.swarms[i];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){ t.pendingConns.splice(t.pendingConns.indexOf(e))}var n=s.createIncomingTCPPeer(e);n.wire.once("handshake",function(i,a){var s=i.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){n.swarm=o;o._addIncomingPeer(n);n.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+n.id+": destroying peer");n.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var n=t.swarms[r];if(n){t.removeSwarm(n);n._onError(e)}}}}).call(this,e("_process"))},{"./peer":16,_process:172,debug:20,dezalgo:23,net:163}],18:[function(e,t,r){(function(r){t.exports=f;var n=e("bitfield");var i=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,i){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new n(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){i("choke")});a.on("unchoke",function(){i("unchoke")});a.once("interested",function(){i("interested");a.unchoke()});a.on("uninterested",function(){i("uninterested")});a.on("bitfield",function(){i("bitfield")});a.on("request",function(e,t,r,n){i("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,n)})}f.prototype.httpRequest=function(e,t,r,n){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return n(e);if(r.statusCode<200||r.statusCode>=300){return n(new Error("Unexpected HTTP status code "+r.statusCode))}i("Got data of length %d",t.length);n(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:19,"bittorrent-protocol":2,buffer:164,debug:20,inherits:27,"simple-get":105}],19:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],20:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":21,dup:8}],21:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:22}],22:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],23:[function(e,t,r){var n=e("wrappy");t.exports=n(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function r(){var r=arguments;var n=this;if(t)i(function(){e.apply(n,r)});else e.apply(n,r)}}},{asap:24,wrappy:26}],24:[function(e,t,r){"use strict";var n=e("./raw");var i=[];var a=[];var s=n.makeRequestCallFromTimer(o);function o(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(i.length){t=i.pop()}else{t=new u}t.task=e;n(t)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);s()}}finally{this.task=null;i[i.length]=this}}},{"./raw":25}],25:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!n.length){a();i=true}n[n.length]=e}var n=[];var i=false;var a;var s=0;var o=1024;function f(){while(so){for(var t=0,r=n.length-s;t1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(n,i){if(n)return r(n);if(Array.isArray(i))i=l(i);else i=[i];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;i.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,i)})}function x(e,t){t=m(t);c.stat(e,function(r,n){if(r)return t(r);var i={length:n.size,path:e};t(null,i)})}function k(e,t,r){c.readdir(e,function(n,i){if(n&&n.code==="ENOTDIR"){t(e,r)}else if(n){r(n)}else{v(i.filter(S).filter(d.not).map(function(r){return function(n){k(o.join(e,r),t,n)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var i=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){i[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new n(i.join(""),"hex"),s)}}}function A(e,n,a){var o=n.announceList;if(!o){if(typeof n.announce==="string")o=[[n.announce]];else if(Array.isArray(n.announce)){o=n.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof n.urlList==="string")n.urlList=[n.urlList];var f={info:{name:n.name},announce:o[0][0],"announce-list":o,"creation date":Number(n.creationDate)||Date.now(),encoding:"UTF-8"};if(n.comment!==undefined)f.comment=n.comment;if(n.createdBy!==undefined)f["created by"]=n.createdBy;if(n.private!==undefined)f.info.private=Number(n.private);if(n.sslCert!==undefined)f.info["ssl-cert"]=n.sslCert;if(n.urlList!==undefined)f["url-list"]=n.urlList;var u=n.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(n.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,i.encode(f))})}function U(e,t){return e+t.length}function T(e){return typeof Blob!=="undefined"&&e instanceof Blob}function I(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,n){t.length+=e.length;this.push(e);n()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:44,"block-stream2":48,buffer:164,dezalgo:60,"filestream/read":67,flatten:68,fs:162,"is-file":69,junk:70,multistream:71,once:74,path:171,"piece-length":75,"run-parallel":100,"simple-sha1":77,stream:190}],44:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":45,"./lib/encode":47,dup:3}],45:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":46,buffer:164,dup:4}],46:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],47:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],48:[function(e,t,r){(function(r){var n=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=s;n(s,i);function s(e,t){if(!(this instanceof s))return new s(e,t);i.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,n){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}n()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:164,defined:49,inherits:50,"readable-stream":59}],49:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!i){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)T(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)T(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=U(e,t);else i=null;if(o.isNull(i)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)T(this);if(!o.isNull(i))this.emit("data",i);return i};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(a)o=r.join("");else o=i.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r1){var r=[];for(var n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:164}],59:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./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,stream:190}],60:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:61,dup:23,wrappy:63}],61:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":62,dup:24}],62:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],63:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],64:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],65:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:164,"is-typedarray":66}],66:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return i[n.call(e)]}},{}],67:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(o,n);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:64,stream:190,"typedarray-to-buffer":65}],68:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n=r){break}r=n;i=t[a]}return i}},{}],77:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=i.digest.bind(i);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function n(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:78}],78:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[i+u+1|0]=a.charCodeAt(r+u+2);case 2:e[i+u+2|0]=a.charCodeAt(r+u+1);case 1:e[i+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[i+u+1|0]=a[r+u+2];case 2:e[i+u+2|0]=a[r+u+1];case 1:e[i+u+3|0]=a[r+u]}};var l=function(e,t,r,n,a){var s=this,o,f=a%4,u=n%4,l=n-u;var c=new Uint8Array(i.readAsArrayBuffer(s.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);s(i,e);o(i,e,r);return n};var y=function(e,r,n){c(e)(t.h8,t.h32,r,n,0)};var _=function(e,r,n,i,a){var s=n;if(a){s=g(n,i)}y(e,r,n);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){_(e,n,i,r,false)}_(e,n,r-n,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}n._core=function s(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=n[t+320>>2]|0;o=n[t+324>>2]|0;u=n[t+328>>2]|0;c=n[t+332>>2]|0;d=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(i=0;(i|0)<64;i=i+4|0){v=n[r+i>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[e+i>>2]=v}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}n[t+320>>2]=a;n[t+324>>2]=o;n[t+328>>2]=u;n[t+332>>2]=c;n[t+336>>2]=d}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],79:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function s(e){var t={};var i=e.split("magnet:?")[1];var s=i&&i.length>=0?i.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var i=n.decode(o[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:164,"thirty-two":80,uniq:82,xtend:83}],80:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":81}],81:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var s=0;var o=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;n++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)n++}f[a]=t.charCodeAt(o);a++}for(n=a;n>>r;o[s]=a;s++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:164}],82:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],83:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],84:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=typeof e==="function"?e:e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();if(typeof this._queue!=="function"){this._queue.forEach(function(e){if(e.destroy)e.destroy()})}if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;var t=typeof e._queue==="function"?e._queue():e._queue.shift();if(typeof t==="function")t=s(t());if(!t){e.destroy();e.push(null);return}e._current=t;t.on("readable",r);t.on("end",i);t.on("error",a);t.on("close",n);function r(){e._forward()}function n(){if(!t._readableState.ended){e.destroy()}}function i(){e._current=null;t.removeListener("readable",r);t.removeListener("end",i);t.removeListener("error",a);t.removeListener("close",n);e._next()}function a(t){e.destroy(t)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:85,stream:190}],85:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],86:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=n.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:164,http:191,https:169,"object-assign":106,once:108,"unzip-response":163,url:201}],106:[function(e,t,r){"use strict";var n=Object.prototype.propertyIsEnumerable;function i(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return n.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var n;var s=i(e);for(var o=1;on._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:164,debug:110,"get-browser-rtc":113,hat:114,inherits:115,"is-typedarray":116,once:118,stream:190,"typedarray-to-buffer":131}],110:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":111,dup:8}],111:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:112}],112:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],113:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],114:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],115:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],116:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],117:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],118:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40,wrappy:117}],119:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;i(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var i=r._ws;var a=function(){i.onclose=null;r.emit("close")};if(i.readyState===u.CLOSED){a()}else{try{i.onclose=a;i.close()}catch(e){a()}}i.onopen=null;i.onmessage=null;i.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=o(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:164,debug:120,inherits:123,"is-typedarray":124,stream:190,"typedarray-to-buffer":131,ws:163}],120:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":121,dup:8}],121:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:122}],122:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],123:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],124:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],125:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("torrent-discovery");var a=e("bittorrent-dht/client");var s=e("events").EventEmitter;var o=e("xtend/mutable");var f=e("inherits");var u=e("run-parallel");var l=e("re-emitter");var c=e("bittorrent-tracker/client");f(p,s);function p(e){var t=this;if(!(t instanceof p))return new p(e);s.call(t);o(t,{announce:[],dht:typeof a==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t.infoHash=null;t.infoHashHex=null;t.torrent=null;t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}p.prototype.setTorrent=function(e){var t=this;if(!t.infoHash&&n.isBuffer(e)||typeof e==="string"){t.infoHash=typeof e==="string"?new n(e,"hex"):e}else if(!t.torrent&&e&&e.infoHash){t.torrent=e;t.infoHash=typeof e.infoHash==="string"?new n(e.infoHash,"hex"):e.infoHash}else{return}t.infoHashHex=t.infoHash.toString("hex");i("setTorrent %s",t.infoHashHex);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};p.prototype.stop=function(e){var t=this;var r=[];if(t.tracker&&t.tracker!==true){t.tracker.stop();r.push(function(e){t.tracker.destroy(e)})}if(!t._externalDHT&&t.dht&&t.dht!==true){r.push(function(e){t.dht.destroy(e)})}u(r,e)};p.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new a;l(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHashHex)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};p.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHashHex,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);l(e.tracker,e,["peer","warning","error"]);e.tracker.on("update",function(t){e.emit("trackerAnnounce",t)});e.tracker.start()};p.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"),e("buffer").Buffer)},{_process:172,"bittorrent-dht/client":163,"bittorrent-tracker/client":29,buffer:164,debug:126,events:168,inherits:129,"re-emitter":99,"run-parallel":100,"xtend/mutable":130}],126:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":127,dup:8}],127:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:128}],128:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],129:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],130:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],131:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{buffer:164,dup:65,"is-typedarray":132}],132:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],133:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var u=1e3;var l=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:u});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:134,bitfield:138,buffer:164,events:168,inherits:139,"simple-sha1":140}],134:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":135,"./lib/encode":137,dup:3}],135:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":136,buffer:164,dup:4}],136:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],137:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],138:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],139:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],140:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:141}],141:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],142:[function(e,t,r){var n=e("debug")("webtorrent:append-to");var i=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var u=[".mp4",".m4v",".webm"];var l=[".m4a",".mp3"];var c=u.concat(l);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=i(r||function(){});var l;var v=s.extname(e.name).toLowerCase();var g=0;if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)y();else if(p.indexOf(v)>=0)b();else if(d.indexOf(v)>=0)w();else if(h.indexOf(v)>=0)x();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function y(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var i=u.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){n("Use `videostream` package for "+e.name);y();l.addEventListener("error",d);l.addEventListener("playing",_);o(e,l)}function c(){n("Use MediaSource API for "+e.name);y();l.addEventListener("error",h);l.addEventListener("playing",_);e.createReadStream().pipe(new a(l,{extname:v}));if(g)l.currentTime=g}function p(){n("Use Blob URL for "+e.name);y();l.addEventListener("error",k);l.addEventListener("playing",_);e.getBlobURL(function(e,t){if(e)return k(e);l.src=t;if(g)l.currentTime=g})}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e);l.removeEventListener("error",d);l.removeEventListener("playing",_);c()}function h(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e);l.removeEventListener("error",h);l.removeEventListener("playing",_);p()}function y(e){if(!l){l=document.createElement(i);l.controls=true;l.autoplay=true;l.play();l.addEventListener("progress",function(){g=l.currentTime});t.appendChild(l)}}}function _(){l.removeEventListener("playing",_);r(null,l)}function b(){l=document.createElement("audio");l.controls=true;l.autoplay=true;t.appendChild(l);e.getBlobURL(function(e,t){if(e)return k(e);l.addEventListener("error",k);l.addEventListener("playing",_);l.src=t;l.play()})}function w(){e.getBlobURL(function(n,i){if(n)return k(n);l=document.createElement("img");l.src=i;l.alt=e.name;t.appendChild(l);r(null)})}function x(){e.getBlobURL(function(e,n){if(e)return k(e);l=document.createElement("iframe");l.src=n;if(v!==".pdf")l.sandbox="allow-forms allow-scripts";t.appendChild(l);r(null)})}function k(t){if(l)l.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;n(t.message);if(r)r(t)}}},{"./media-stream":144,debug:202,dezalgo:205,path:171,videostream:229}],143:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("stream");i(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var o=t.pieceLength;r.startPiece=i/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=i-r.startPiece*o}s.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,i){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}n("read %s (length %s) (err %s)",t,i.length,r&&r.message);if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],147:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:202,http:191,mime:212,pump:216,"range-parser":218,url:201}],148:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var _=16*1024;var b=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/_;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=_;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(_,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*_;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*_)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||I});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};L.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;aw){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};L.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),U);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};L.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};L.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};L.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=B(e,A);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>S)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=S)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};L.prototype.createServer=function(e){var t=this;if(typeof _==="function"){var r=new _(t,e);t._servers.push(r);return r}};L.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function B(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function C(e){return Math.random()*e|0}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":146,"./server":147,"./storage":148,_process:172,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":43,debug:202,events:168,inherits:211,"parse-torrent":94,"random-iterate":217,"re-emitter":99,"run-parallel":100,"torrent-discovery":125,uniq:222,ut_metadata:133,ut_pex:163}],150:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],151:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:164,defined:152,dup:48,inherits:211,"readable-stream":161}],152:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],153:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{"./_stream_readable":155,"./_stream_writable":157,_process:172,"core-util-is":158,dup:51,inherits:211}],154:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{"./_stream_transform":156,"core-util-is":158,dup:52,inherits:211}],155:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:53,events:168,inherits:211,isarray:159,stream:190,"string_decoder/":160,util:163}],156:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{"./_stream_duplex":153,"core-util-is":158,dup:54,inherits:211}],157:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:55,inherits:211,stream:190}],158:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{buffer:164,dup:56}],159:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],160:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],161:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./lib/_stream_duplex.js":153,"./lib/_stream_passthrough.js":154,"./lib/_stream_readable.js":155,"./lib/_stream_transform.js":156,"./lib/_stream_writable.js":157,dup:59,stream:190}],162:[function(e,t,r){},{}],163:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],164:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=_;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8"); -}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function _(e,t){if(!(this instanceof _))return new _(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=b;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ue(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":165,ieee754:166,"is-array":167}],165:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],166:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],167:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],168:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],169:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:191}],170:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],171:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function T(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(b,".");var i=e.split(".");var a=U(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-i)/y)){A("overflow")}i+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,_=[],b,w,x,E;e=I(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],175:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t)}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"; -};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":192,_process:172,buffer:164,foreach:196,inherits:211,stream:190}],195:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],196:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString;t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r}},{}],200:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],201:[function(e,t,r){var n=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:173,querystring:176}],202:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":203,dup:8}],203:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:204}],204:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],205:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:206,dup:23,wrappy:208}],206:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":207,dup:24}],207:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],208:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],209:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:215}],210:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],211:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],212:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":209,fs:162,once:215}],217:[function(e,t,r){var n=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var n=Math.random()*r|0;var i=e[t+n];var a=e[t];e[t]=i;e[t+n]=a;t++;return i}};t.exports=n},{}],218:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],219:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:220}],220:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],221:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],222:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],223:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],224:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"] -},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":227}],226:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=n.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],228:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;ai){break}else if(o>=0||i<=l){o=l}}var c=o-i;if(c<0)c=0;n("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new i;m.onError=function(e){n("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){n("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var n={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,n));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=n}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,n){var i=g[e];S(i,r,n===i.meta.nb_samples);if(e===f&&u){u.push(r);if(n>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var i={start:y,end:e.length-1};_=e.createReadStream(i);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){n("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:202,mp4box:228}],230:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],231:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.56.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",executable:"^1.1.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0", -standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],232:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var _=e("./lib/storage");var b=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:_;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[232])(232)}); +u("wrapped data");if(t.decoder)i=t.decoder.write(i);if(!i||!t.objectMode&&!i.length)return;var a=n.push(i);if(!a){r=true;e.pause()}});for(var i in e){if(o.isFunction(e[i])&&o.isUndefined(this[i])){this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i)}}var a=["error","close","destroy","pause","resume"];I(a,function(t){e.on(t,n.emit.bind(n,t))});n._read=function(t){u("wrapped _read",t);if(r){r=false;e.resume()}};return n};c._fromList=U;function U(e,t){var r=t.buffer;var n=t.length;var a=!!t.decoder;var s=!!t.objectMode;var o;if(r.length===0)return null;if(n===0)o=null;else if(s)o=r.shift();else if(!e||e>=n){if(a)o=r.join("");else o=i.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r1){var r=[];for(var n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:164}],59:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./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,stream:190}],60:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:61,dup:23,wrappy:63}],61:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":62,dup:24}],62:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],63:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],64:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],65:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:164,"is-typedarray":66}],66:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return i[n.call(e)]}},{}],67:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(o,n);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:64,stream:190,"typedarray-to-buffer":65}],68:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n=r){break}r=n;i=t[a]}return i}},{}],77:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=i.digest.bind(i);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function n(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:78}],78:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[i+u+1|0]=a.charCodeAt(r+u+2);case 2:e[i+u+2|0]=a.charCodeAt(r+u+1);case 1:e[i+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[i+u+1|0]=a[r+u+2];case 2:e[i+u+2|0]=a[r+u+1];case 1:e[i+u+3|0]=a[r+u]}};var l=function(e,t,r,n,a){var s=this,o,f=a%4,u=n%4,l=n-u;var c=new Uint8Array(i.readAsArrayBuffer(s.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);s(i,e);o(i,e,r);return n};var y=function(e,r,n){c(e)(t.h8,t.h32,r,n,0)};var _=function(e,r,n,i,a){var s=n;if(a){s=g(n,i)}y(e,r,n);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){_(e,n,i,r,false)}_(e,n,r-n,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}n._core=function s(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=n[t+320>>2]|0;o=n[t+324>>2]|0;u=n[t+328>>2]|0;c=n[t+332>>2]|0;d=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(i=0;(i|0)<64;i=i+4|0){v=n[r+i>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[e+i>>2]=v}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}n[t+320>>2]=a;n[t+324>>2]=o;n[t+328>>2]=u;n[t+332>>2]=c;n[t+336>>2]=d}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],79:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function s(e){var t={};var i=e.split("magnet:?")[1];var s=i&&i.length>=0?i.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var i=n.decode(o[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:164,"thirty-two":80,uniq:82,xtend:83}],80:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":81}],81:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var s=0;var o=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;n++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)n++}f[a]=t.charCodeAt(o);a++}for(n=a;n>>r;o[s]=a;s++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:164}],82:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],83:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],84:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=typeof e==="function"?e:e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained||!this._current)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();if(typeof this._queue!=="function"){this._queue.forEach(function(e){if(e.destroy)e.destroy()})}if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;e._current=null;if(typeof e._queue==="function"){e._queue(function(t,r){if(t)return e.destroy(t);e._gotNextStream(s(r))})}else{var t=e._queue.shift();if(typeof t==="function")t=s(t());e._gotNextStream(t)}};a.prototype._gotNextStream=function(e){var t=this;if(!e){t.push(null);t.destroy();return}t._current=e;t._forward();e.on("readable",r);e.on("end",i);e.on("error",a);e.on("close",n);function r(){t._forward()}function n(){if(!e._readableState.ended){t.destroy()}}function i(){t._current=null;e.removeListener("readable",r);e.removeListener("end",i);e.removeListener("error",a);e.removeListener("close",n);t._next()}function a(e){t.destroy(e)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:85,stream:190}],85:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],86:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=n.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:164,http:191,https:169,"object-assign":106,once:108,"unzip-response":163,url:201}],106:[function(e,t,r){"use strict";var n=Object.prototype.propertyIsEnumerable;function i(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return n.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var n;var s=i(e);for(var o=1;on._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:164,debug:110,"get-browser-rtc":113,hat:114,inherits:115,"is-typedarray":116,once:118,stream:190,"typedarray-to-buffer":131}],110:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":111,dup:8}],111:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:112}],112:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],113:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],114:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],115:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],116:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],117:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],118:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40,wrappy:117}],119:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;i(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var i=r._ws;var a=function(){i.onclose=null;r.emit("close")};if(i.readyState===u.CLOSED){a()}else{try{i.onclose=a;i.close()}catch(e){a()}}i.onopen=null;i.onmessage=null;i.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=o(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:164,debug:120,inherits:123,"is-typedarray":124,stream:190,"typedarray-to-buffer":131,ws:163}],120:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":121,dup:8}],121:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:122}],122:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],123:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],124:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],125:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("torrent-discovery");var a=e("bittorrent-dht/client");var s=e("events").EventEmitter;var o=e("xtend/mutable");var f=e("inherits");var u=e("run-parallel");var l=e("re-emitter");var c=e("bittorrent-tracker/client");f(p,s);function p(e){var t=this;if(!(t instanceof p))return new p(e);s.call(t);o(t,{announce:[],dht:typeof a==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t.infoHash=null;t.infoHashHex=null;t.torrent=null;t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}p.prototype.setTorrent=function(e){var t=this;if(!t.infoHash&&n.isBuffer(e)||typeof e==="string"){t.infoHash=typeof e==="string"?new n(e,"hex"):e}else if(!t.torrent&&e&&e.infoHash){t.torrent=e;t.infoHash=typeof e.infoHash==="string"?new n(e.infoHash,"hex"):e.infoHash}else{return}t.infoHashHex=t.infoHash.toString("hex");i("setTorrent %s",t.infoHashHex);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};p.prototype.stop=function(e){var t=this;var r=[];if(t.tracker&&t.tracker!==true){t.tracker.stop();r.push(function(e){t.tracker.destroy(e)})}if(!t._externalDHT&&t.dht&&t.dht!==true){r.push(function(e){t.dht.destroy(e)})}u(r,e)};p.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new a;l(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHashHex)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};p.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHashHex,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);l(e.tracker,e,["peer","warning","error"]);e.tracker.on("update",function(t){e.emit("trackerAnnounce",t)});e.tracker.start()};p.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"),e("buffer").Buffer)},{_process:172,"bittorrent-dht/client":163,"bittorrent-tracker/client":29,buffer:164,debug:126,events:168,inherits:129,"re-emitter":99,"run-parallel":100,"xtend/mutable":130}],126:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":127,dup:8}],127:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:128}],128:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],129:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],130:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],131:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{buffer:164,dup:65,"is-typedarray":132}],132:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],133:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var u=1e3;var l=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:u});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:134,bitfield:138,buffer:164,events:168,inherits:139,"simple-sha1":140}],134:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":135,"./lib/encode":137,dup:3}],135:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":136,buffer:164,dup:4}],136:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],137:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],138:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],139:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],140:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:141}],141:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],142:[function(e,t,r){var n=e("debug")("webtorrent:append-to");var i=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var u=[".mp4",".m4v",".webm"];var l=[".m4a",".mp3"];var c=u.concat(l);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=i(r||function(){});var l;var v=s.extname(e.name).toLowerCase();var g=0;if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)y();else if(p.indexOf(v)>=0)b();else if(d.indexOf(v)>=0)w();else if(h.indexOf(v)>=0)x();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function y(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var i=u.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){n("Use `videostream` package for "+e.name);y();l.addEventListener("error",d);l.addEventListener("playing",_);o(e,l)}function c(){n("Use MediaSource API for "+e.name);y();l.addEventListener("error",h);l.addEventListener("playing",_);e.createReadStream().pipe(new a(l,{extname:v}));if(g)l.currentTime=g}function p(){n("Use Blob URL for "+e.name);y();l.addEventListener("error",k);l.addEventListener("playing",_);e.getBlobURL(function(e,t){if(e)return k(e);l.src=t;if(g)l.currentTime=g})}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e);l.removeEventListener("error",d);l.removeEventListener("playing",_);c()}function h(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e);l.removeEventListener("error",h);l.removeEventListener("playing",_);p()}function y(e){if(!l){l=document.createElement(i);l.controls=true;l.autoplay=true;l.play();l.addEventListener("progress",function(){g=l.currentTime});t.appendChild(l)}}}function _(){l.removeEventListener("playing",_);r(null,l)}function b(){l=document.createElement("audio");l.controls=true;l.autoplay=true;t.appendChild(l);e.getBlobURL(function(e,t){if(e)return k(e);l.addEventListener("error",k);l.addEventListener("playing",_);l.src=t;l.play()})}function w(){e.getBlobURL(function(n,i){if(n)return k(n);l=document.createElement("img");l.src=i;l.alt=e.name;t.appendChild(l);r(null)})}function x(){e.getBlobURL(function(e,n){if(e)return k(e);l=document.createElement("iframe");l.src=n;if(v!==".pdf")l.sandbox="allow-forms allow-scripts";t.appendChild(l);r(null)})}function k(t){if(l)l.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;n(t.message);if(r)r(t)}}},{"./media-stream":144,debug:202,dezalgo:205,path:171,videostream:229}],143:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("stream");i(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var o=t.pieceLength;r.startPiece=i/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=i-r.startPiece*o}s.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,i){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}n("read %s (length %s) (err %s)",t,i.length,r&&r.message);if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],147:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:202,http:191,mime:212,pump:216,"range-parser":218,url:201}],148:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var _=16*1024;var b=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/_;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=_;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(_,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*_;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*_)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||I});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};L.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;aw){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};L.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),U);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};L.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};L.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};L.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=B(e,A);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>S)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=S)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};L.prototype.createServer=function(e){var t=this;if(typeof _==="function"){var r=new _(t,e);t._servers.push(r);return r}};L.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function B(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function C(e){return Math.random()*e|0}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":146,"./server":147,"./storage":148,_process:172,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":43,debug:202,events:168,inherits:211,"parse-torrent":94,"random-iterate":217,"re-emitter":99,"run-parallel":100,"torrent-discovery":125,uniq:222,ut_metadata:133,ut_pex:163}],150:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],151:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:164,defined:152,dup:48,inherits:211,"readable-stream":161}],152:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],153:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{"./_stream_readable":155,"./_stream_writable":157,_process:172,"core-util-is":158,dup:51,inherits:211}],154:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{"./_stream_transform":156,"core-util-is":158,dup:52,inherits:211}],155:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:53,events:168,inherits:211,isarray:159,stream:190,"string_decoder/":160,util:163}],156:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{"./_stream_duplex":153,"core-util-is":158,dup:54,inherits:211}],157:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:55,inherits:211,stream:190}],158:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{buffer:164,dup:56}],159:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],160:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],161:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./lib/_stream_duplex.js":153,"./lib/_stream_passthrough.js":154,"./lib/_stream_readable.js":155,"./lib/_stream_transform.js":156,"./lib/_stream_writable.js":157,dup:59,stream:190}],162:[function(e,t,r){},{}],163:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],164:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=_;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){ +if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function _(e,t){if(!(this instanceof _))return new _(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=b;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ue(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":165,ieee754:166,"is-array":167}],165:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],166:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],167:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],168:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],169:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:191}],170:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],171:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function T(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(b,".");var i=e.split(".");var a=U(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-i)/y)){A("overflow")}i+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,_=[],b,w,x,E;e=I(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],175:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t); +}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":192,_process:172,buffer:164,foreach:196,inherits:211,stream:190}],195:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],196:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString; +t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r}},{}],200:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],201:[function(e,t,r){var n=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:173,querystring:176}],202:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":203,dup:8}],203:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:204}],204:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],205:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:206,dup:23,wrappy:208}],206:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":207,dup:24}],207:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],208:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],209:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:215}],210:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],211:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],212:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":209,fs:162,once:215}],217:[function(e,t,r){var n=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var n=Math.random()*r|0;var i=e[t+n];var a=e[t];e[t]=i;e[t+n]=a;t++;return i}};t.exports=n},{}],218:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],219:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:220}],220:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],221:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],222:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],223:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],224:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]], +sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":227}],226:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=n.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],228:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;ai){break}else if(o>=0||i<=l){o=l}}var c=o-i;if(c<0)c=0;n("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new i;m.onError=function(e){n("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){n("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var n={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,n));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=n}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,n){var i=g[e];S(i,r,n===i.meta.nb_samples);if(e===f&&u){u.push(r);if(n>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var i={start:y,end:e.length-1};_=e.createReadStream(i);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){n("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:202,mp4box:228}],230:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],231:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.57.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",executable:"^1.1.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0" +},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],232:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var _=e("./lib/storage");var b=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:_;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[232])(232)}); From c221fa7088040af4b82b13bd315e8a5da432728d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Fri, 14 Aug 2015 22:39:03 +0200 Subject: [PATCH 029/109] adhere to padded-blocks --- bin/cmd.js | 1 - index.js | 1 - lib/torrent.js | 1 - 3 files changed, 3 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index 0160b5c1..5cc5b966 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -254,7 +254,6 @@ function runCreate (input) { var client, href, playerName, server, serving function runDownload (torrentId) { - if (!argv.out && !argv.stdout && !playerName) { argv.out = process.cwd() } diff --git a/index.js b/index.js index 8e638adc..cd8f7d7a 100644 --- a/index.js +++ b/index.js @@ -169,7 +169,6 @@ WebTorrent.prototype.download = function (torrentId, opts, ontorrent) { if (torrent) { if (torrent.ready) process.nextTick(_ontorrent) else torrent.on('ready', _ontorrent) - } else { torrent = new Torrent(torrentId, opts) self.torrents.push(torrent) diff --git a/lib/torrent.js b/lib/torrent.js index 4149faf1..eff64331 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -529,7 +529,6 @@ Torrent.prototype._onWire = function (wire, addr) { // If peer supports DHT, send PORT message to report DHT listening port if (wire.peerExtensions.dht && self.client.dht && self.client.dht.listening) { - // When peer sends PORT, add them to the routing table wire.on('port', function (port) { if (!wire.remoteAddress) { From a076dc3608ba8bbe8b3847289c8d85f6a317238d Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Sun, 16 Aug 2015 22:32:44 +0200 Subject: [PATCH 030/109] Also test for standard when running test-node --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ad48ea6a..b10599e3 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,6 @@ "test": "standard && node ./bin/test.js", "test-browser": "zuul -- test/basic.js", "test-browser-local": "zuul --local -- test/basic.js", - "test-node": "tape test/*.js" + "test-node": "standard && tape test/*.js" } } From f48ff319bd6ae9bdaed03cf9e29a264c4c47dacb Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 20 Aug 2015 15:47:49 +0200 Subject: [PATCH 031/109] Revert "Also test for standard when running test-node" This reverts commit af0929b96e6211a028294a8926e1dfdc5c43c101. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b10599e3..ad48ea6a 100644 --- a/package.json +++ b/package.json @@ -108,6 +108,6 @@ "test": "standard && node ./bin/test.js", "test-browser": "zuul -- test/basic.js", "test-browser-local": "zuul --local -- test/basic.js", - "test-node": "standard && tape test/*.js" + "test-node": "tape test/*.js" } } From bf180bc3d93725047c00fd7d728f818acf4d2c1b Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 20 Aug 2015 15:48:34 +0200 Subject: [PATCH 032/109] standard@5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ad48ea6a..a423b8a1 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "run-auto": "^1.0.0", "serve-static": "^1.9.3", "simple-get": "^1.0.0", - "standard": "^4.0.1", + "standard": "^5.1.0", "tape": "^4.0.0", "uglify-js": "^2.4.15", "zelda": "^2.0.0", From db50972b07e93ea7dc09a80c25b7dbd47ebc04aa Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 20 Aug 2015 15:49:01 +0200 Subject: [PATCH 033/109] multistream@2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a423b8a1..0c03eaf1 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "minimist": "^1.1.0", "mkdirp": "^0.5.0", "moment": "^2.8.3", - "multistream": "^1.4.2", + "multistream": "^2.0.2", "network-address": "^1.0.0", "once": "^1.3.1", "parse-torrent": "^5.1.0", From e699999f774a96ebbd9114eb355a4f8187a14418 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 14:46:16 +0200 Subject: [PATCH 034/109] BREAKING: Use abstract-chunk-store for storage Part of an effort to share more code with `torrent-stream` by @mafintosh: https://github.com/mafintosh/torrent-stream/pull/133 https://github.com/mafintosh/torrent-stream/pull/132 Storage is now based on: https://www.npmjs.com/package/fs-chunk-store (in node) https://www.npmjs.com/package/memory-chunk-store (in the browser) and: https://www.npmjs.com/package/immediate-chunk-store https://www.npmjs.com/package/torrent-piece This is a BREAKING change, since users who pass in custom storage engine with `opts.storage` will need to update their storage backend to be `abstract-chunk-store` compliant: https://www.npmjs.com/package/abstract-chunk-store There are also likely other miscellaneous BREAKING API changes, since this was a huge refactor of the codebase. --- README.md | 10 +- bin/cmd.js | 34 +- index.js | 63 +-- lib/append-to.js | 4 +- lib/file-stream.js | 86 ++-- lib/file.js | 120 ++++++ lib/fs-storage.js | 211 ---------- lib/load-chunk-store.js | 61 +++ lib/storage.js | 683 ------------------------------- lib/torrent.js | 551 +++++++++++++------------ package.json | 7 +- test/download-dht-magnet.js | 2 +- test/download-dht-torrent.js | 2 +- test/download-tracker-magnet.js | 2 +- test/download-tracker-torrent.js | 2 +- test/server.js | 2 +- test/storage.js | 61 --- 17 files changed, 567 insertions(+), 1334 deletions(-) create mode 100644 lib/file.js delete mode 100644 lib/fs-storage.js create mode 100644 lib/load-chunk-store.js delete mode 100644 lib/storage.js delete mode 100644 test/storage.js diff --git a/README.md b/README.md index 9e7d348a..94ab6af4 100644 --- a/README.md +++ b/README.md @@ -230,9 +230,8 @@ If `opts` is specified, then the default options (shown below) will be overridde nodeId: String|Buffer, // DHT protocol node ID (default=randomly generated) peerId: String|Buffer, // Wire protocol peer ID (default=randomly generated) rtcConfig: Object, // RTCPeerConnection configuration object (default=STUN only) - storage: Function, // custom storage engine, or `false` to use in-memory engine tracker: Boolean, // Whether or not to enable trackers (default=true) - wrtc: {} // custom webrtc implementation (in node, specify the [wrtc](https://www.npmjs.com/package/wrtc) package) + wrtc: {} // Custom webrtc implementation (in node, specify the [wrtc](https://www.npmjs.com/package/wrtc) package) } ``` @@ -253,9 +252,10 @@ If `opts` is specified, then the default options (shown below) will be overridde ```js { - announce: [], // List of additional trackers to use (added to list in .torrent or magnet uri) - path: String, // Folder where files will be downloaded (default=`/tmp/webtorrent/`) - verify: Boolean // Verify previously stored data before starting (default=false) + announce: [], // List of additional trackers to use (added to list in .torrent or magnet uri) + path: String, // Folder where files will be downloaded (default=`/tmp/webtorrent/`) + storage: Function, // Custom storage engine (must follow `abstract-chunk-store` API) + verify: Boolean // Verify previously stored data before starting (default=false) } ``` diff --git a/bin/cmd.js b/bin/cmd.js index 5cc5b966..2ca529dd 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -12,7 +12,6 @@ var networkAddress = require('network-address') var parseTorrent = require('parse-torrent') var path = require('path') var prettyBytes = require('pretty-bytes') -var Storage = require('../lib/storage') var WebTorrent = require('../') var zeroFill = require('zero-fill') @@ -511,7 +510,7 @@ function drawTorrent (torrent) { linesRemaining -= 1 } - var seeding = torrent.storage.done + var seeding = torrent.done if (!seeding) clivas.line('') clivas.line( @@ -540,34 +539,29 @@ function drawTorrent (torrent) { linesRemaining -= 5 if (argv.verbose) { - var pieces = torrent.storage.pieces - var memoryUsage = 0 + var pieces = torrent.pieces for (var i = 0; i < pieces.length; i++) { var piece = pieces[i] - if (piece.buffer) memoryUsage += piece.buffer.length if (piece.verified || (piece.blocksWritten === 0 && !piece.blocks[0])) continue var bar = '' for (var j = 0; j < piece.blocks.length; j++) { - switch (piece.blocks[j]) { - case Storage.BLOCK_BLANK: - bar += '{red:█}' - break - case Storage.BLOCK_RESERVED: - bar += '{blue:█}' - break - case Storage.BLOCK_WRITTEN: - bar += '{green:█}' - break - } + // switch (piece.blocks[j]) { + // case Storage.BLOCK_BLANK: + // bar += '{red:█}' + // break + // case Storage.BLOCK_RESERVED: + // bar += '{blue:█}' + // break + // case Storage.BLOCK_WRITTEN: + // bar += '{green:█}' + // break + // } } clivas.line('{4+cyan:' + i + '} ' + bar) linesRemaining -= 1 } - clivas.line( - '{red:memory usage:} {bold:' + prettyBytes(memoryUsage) + '}' - ) clivas.line('{80:}') - linesRemaining -= 2 + linesRemaining -= 1 } torrent.swarm.wires.every(function (wire) { diff --git a/index.js b/index.js index cd8f7d7a..ad963205 100644 --- a/index.js +++ b/index.js @@ -14,8 +14,6 @@ var speedometer = require('speedometer') var zeroFill = require('zero-fill') var path = require('path') -var FSStorage = require('./lib/fs-storage') // browser exclude -var Storage = require('./lib/storage') var Torrent = require('./lib/torrent') inherits(WebTorrent, EventEmitter) @@ -53,12 +51,6 @@ function WebTorrent (opts) { self.downloadSpeed = speedometer() self.uploadSpeed = speedometer() - self.storage = typeof opts.storage === 'function' - ? opts.storage - : (opts.storage !== false && typeof FSStorage === 'function' /* browser exclude */) - ? FSStorage - : Storage - self.peerId = opts.peerId === undefined ? new Buffer('-WW' + VERSION_STR + '-' + hat(48), 'utf8') : typeof opts.peerId === 'string' @@ -85,7 +77,7 @@ function WebTorrent (opts) { loadIPSet(opts.blocklist, { headers: { 'user-agent': 'WebTorrent (http://webtorrent.io)' } }, function (err, ipSet) { - if (err) return self.error('failed to load blocklist: ' + err.message) + if (err) return self.error('Failed to load blocklist: ' + err.message) self.blocked = ipSet ready() }) @@ -126,13 +118,13 @@ Object.defineProperty(WebTorrent.prototype, 'ratio', { WebTorrent.prototype.get = function (torrentId) { var self = this if (torrentId instanceof Torrent) return torrentId + var parsed - try { - parsed = parseTorrent(torrentId) - } catch (err) { - return null - } + try { parsed = parseTorrent(torrentId) } catch (err) {} + + if (!parsed) return null if (!parsed.infoHash) throw new Error('Invalid torrent identifier') + for (var i = 0, len = self.torrents.length; i < len; i++) { var torrent = self.torrents[i] if (torrent.infoHash === parsed.infoHash) return torrent @@ -150,19 +142,16 @@ WebTorrent.prototype.add = WebTorrent.prototype.download = function (torrentId, opts, ontorrent) { var self = this if (self.destroyed) throw new Error('client is destroyed') + if (typeof opts === 'function') return self.add(torrentId, null, opts) debug('add') - if (typeof opts === 'function') { - ontorrent = opts - opts = {} - } if (!opts) opts = {} - if (!opts.storage) opts.storage = self.storage + opts.client = self var torrent = self.get(torrentId) function _ontorrent () { - debug('on torrent') + debug('on torrent %s', torrent.infoHash) if (typeof ontorrent === 'function') ontorrent(torrent) } @@ -194,29 +183,24 @@ WebTorrent.prototype.download = function (torrentId, opts, ontorrent) { /** * Start seeding a new file/folder. * @param {string|File|FileList|Buffer|Array.} input - * @param {Object} opts - * @param {function} onseed + * @param {Object=} opts + * @param {function=} onseed */ WebTorrent.prototype.seed = function (input, opts, onseed) { var self = this if (self.destroyed) throw new Error('client is destroyed') + if (typeof opts === 'function') return self.seed(input, null, opts) debug('seed') - if (typeof opts === 'function') { - onseed = opts - opts = {} - } if (!opts) opts = {} - opts.noVerify = true - opts.createdBy = 'WebTorrent/' + VERSION - // When seeding from filesystem path, don't perform extra copy to /tmp - // Issue: https://github.com/feross/webtorrent/issues/357 - if (typeof input === 'string' && !opts.path) opts.path = path.dirname(input) + // When seeding from filesystem path, storage should use existing location + if (typeof input === 'string') opts.path = path.dirname(input) + if (!opts.createdBy) opts.createdBy = 'WebTorrent/' + VERSION var streams var torrent = self.add(undefined, opts, function (torrent) { var tasks = [function (cb) { - torrent.storage.load(streams, cb) + torrent.load(streams, cb) }] if (self.dht) { tasks.push(function (cb) { @@ -264,9 +248,11 @@ WebTorrent.prototype.seed = function (input, opts, onseed) { */ WebTorrent.prototype.remove = function (torrentId, cb) { var self = this + debug('remove') + var torrent = self.get(torrentId) if (!torrent) throw new Error('No torrent with id ' + torrentId) - debug('remove') + self.torrents.splice(self.torrents.indexOf(torrent), 1) torrent.destroy(cb) } @@ -282,20 +268,15 @@ WebTorrent.prototype.address = function () { */ WebTorrent.prototype.destroy = function (cb) { var self = this + if (self.destroyed) throw new Error('client already destroyed') self.destroyed = true debug('destroy') var tasks = self.torrents.map(function (torrent) { - return function (cb) { - self.remove(torrent, cb) - } + return function (cb) { self.remove(torrent, cb) } }) - if (self.dht) { - tasks.push(function (cb) { - self.dht.destroy(cb) - }) - } + if (self.dht) tasks.push(function (cb) { self.dht.destroy(cb) }) parallel(tasks, cb) } diff --git a/lib/append-to.js b/lib/append-to.js index 2c3e5d52..8d09b0b5 100644 --- a/lib/append-to.js +++ b/lib/append-to.js @@ -17,7 +17,7 @@ var IFRAME_EXTS = [ '.css', '.html', '.js', '.md', '.pdf', '.txt' ] var MediaSource = typeof window !== 'undefined' && window.MediaSource module.exports = function appendTo (file, rootElem, cb) { - cb = dezalgo(cb || function () {}) + cb = dezalgo(cb || noop) var elem var extname = path.extname(file.name).toLowerCase() var currentTime = 0 @@ -159,3 +159,5 @@ module.exports = function appendTo (file, rootElem, cb) { if (cb) cb(err) } } + +function noop () {} diff --git a/lib/file-stream.js b/lib/file-stream.js index 5713aff4..bd5f384f 100644 --- a/lib/file-stream.js +++ b/lib/file-stream.js @@ -7,71 +7,58 @@ var stream = require('stream') inherits(FileStream, stream.Readable) /** - * A readable stream of a torrent file. + * Readable stream of a torrent file * - * @param {Object} file + * @param {File} file + * @param {Object} opts * @param {number} opts.start stream slice of file, starting from this byte (inclusive) * @param {number} opts.end stream slice of file, ending with this byte (inclusive) - * @param {number} opts.pieceLength length of an individual piece */ function FileStream (file, opts) { - var self = this - if (!(self instanceof FileStream)) return new FileStream(file, opts) - stream.Readable.call(self, opts) - debug('new filestream %s', JSON.stringify(opts)) - - if (!opts) opts = {} - if (!opts.start) opts.start = 0 - if (!opts.end) opts.end = file.length - 1 - - self.destroyed = false - self.length = opts.end - opts.start + 1 - - var offset = opts.start + file.offset - var pieceLength = opts.pieceLength - - self.startPiece = offset / pieceLength | 0 - self.endPiece = (opts.end + file.offset) / pieceLength | 0 - - self._storage = file.storage - self._piece = self.startPiece - self._missing = self.length - self._reading = false - self._notifying = false - self._criticalLength = Math.min((1024 * 1024 / pieceLength) | 0, 2) - self._offset = offset - (self.startPiece * pieceLength) + stream.Readable.call(this, opts) + + this.destroyed = false + this._torrent = file._torrent + + var start = (opts && opts.start) || 0 + var end = (opts && opts.end) || (file.length - 1) + var pieceLength = file._torrent.pieceLength + + this._startPiece = (start + file.offset) / pieceLength | 0 + this._endPiece = (end + file.offset) / pieceLength | 0 + + this._piece = this._startPiece + this._offset = (start + file.offset) - (this._startPiece * pieceLength) + + this._missing = end - start + 1 + this._reading = false + this._notifying = false + this._criticalLength = Math.min((1024 * 1024 / pieceLength) | 0, 2) } FileStream.prototype._read = function () { - var self = this - debug('_read') - if (self._reading) return - self._reading = true - self.notify() + if (this._reading) return + this._reading = true + this._notify() } -FileStream.prototype.notify = function () { +FileStream.prototype._notify = function () { var self = this - debug('notify') if (!self._reading || self._missing === 0) return - if (!self._storage.bitfield.get(self._piece)) { - return self._storage.emit('critical', self._piece, self._piece + self._criticalLength) + if (!self._torrent.bitfield.get(self._piece)) { + return self._torrent.critical(self._piece, self._piece + self._criticalLength) } if (self._notifying) return self._notifying = true var p = self._piece - self._storage.read(self._piece++, function (err, buffer) { + self._torrent.storage.get(p, function (err, buffer) { + console.log('GOT', p) self._notifying = false - if (self.destroyed) return - - if (err) { - self._storage.emit('error', err) - return self.destroy(err) - } - + if (self.destroyed) { console.log('destroyed'); return } + if (err) return self.destroy(err) debug('read %s (length %s) (err %s)', p, buffer.length, err && err.message) if (self._offset) { @@ -83,6 +70,7 @@ FileStream.prototype.notify = function () { buffer = buffer.slice(0, self._missing) } self._missing -= buffer.length + console.log('missing', self._missing) debug('pushing buffer of length %s', buffer.length) self._reading = false @@ -90,11 +78,11 @@ FileStream.prototype.notify = function () { if (self._missing === 0) self.push(null) }) + self._piece += 1 } FileStream.prototype.destroy = function () { - var self = this - if (self.destroyed) return - self.destroyed = true - self._storage.emit('deselect', self.startPiece, self.endPiece, true) + if (this.destroyed) return + this.destroyed = true + this._torrent.deselect(this._startPiece, this._endPiece, true) } diff --git a/lib/file.js b/lib/file.js new file mode 100644 index 00000000..d85784c1 --- /dev/null +++ b/lib/file.js @@ -0,0 +1,120 @@ +module.exports = File + +var appendTo = require('./append-to') +var eos = require('end-of-stream') +var EventEmitter = require('events').EventEmitter +var FileStream = require('./file-stream') +var inherits = require('inherits') +var mime = require('./mime.json') +var path = require('path') + +inherits(File, EventEmitter) + +/** + * @param {Torrent} torrent torrent that the file belongs to + * @param {Object} file file object from the parsed torrent + */ +function File (torrent, file) { + EventEmitter.call(this) + + this._torrent = torrent + + this.name = file.name + this.path = file.path + this.length = file.length + this.offset = file.offset + + this.done = (this.length === 0) + + var start = file.offset + var end = start + file.length - 1 + + this._startPiece = start / this._torrent.pieceLength | 0 + this._endPiece = end / this._torrent.pieceLength | 0 +} + +/** + * Selects the file to be downloaded, but at a lower priority than files with streams. + * Useful if you know you need the file at a later stage. + */ +File.prototype.select = function () { + if (this.length === 0) return + this._torrent.select(this._startPiece, this._endPiece, false) +} + +/** + * Deselects the file, which means it won't be downloaded unless someone creates a stream + * for it. + */ +File.prototype.deselect = function () { + if (this.length === 0) return + this._torrent.deselect(this._startPiece, this._endPiece, false) +} + +/** + * Create a readable stream to the file. Pieces needed by the stream will be prioritized + * highly and fetched from the swarm first. + * + * @param {Object} opts + * @param {number} opts.start stream slice of file, starting from this byte (inclusive) + * @param {number} opts.end stream slice of file, ending with this byte (inclusive) + * @return {FileStream} + */ +File.prototype.createReadStream = function (opts) { + var self = this + var stream = new FileStream(self, opts) + self._torrent.select(stream._startPiece, stream._endPiece, true, function () { + stream._notify() + }) + eos(stream, function () { + self._torrent.deselect(stream._startPiece, stream._endPiece, true) + }) + return stream +} + +/** + * @param {function} cb + */ +File.prototype.getBuffer = function (cb) { + var buf = new Buffer(this.length) + var offset = 0 + this.createReadStream() + .on('data', function (chunk) { + console.log('data') + chunk.copy(buf, offset) + offset += chunk.length + }) + .on('end', function () { + console.log('END') + cb(null, buf) + }) + .on('error', cb) +} + +/** + * @param {function} cb + */ +File.prototype.getBlobURL = function (cb) { + var self = this + if (typeof window === 'undefined') throw new Error('browser-only method') + + self.getBuffer(function (err, buffer) { + if (err) return cb(err) + var ext = path.extname(self.name).toLowerCase() + var type = mime[ext] + var blob = new window.Blob([ buffer ], type && { type: type }) + var url = window.URL.createObjectURL(blob) + cb(null, url) + }) +} + +/** + * Show the file in a the browser by appending it to the DOM. + * @param {Element|string} elem + * @param {function} cb + */ +File.prototype.appendTo = function (elem, cb) { + if (typeof window === 'undefined') throw new Error('browser-only method') + if (typeof elem === 'string') elem = document.querySelector(elem) + appendTo(this, elem, cb) +} diff --git a/lib/fs-storage.js b/lib/fs-storage.js deleted file mode 100644 index 1172c149..00000000 --- a/lib/fs-storage.js +++ /dev/null @@ -1,211 +0,0 @@ -module.exports = FSStorage - -var dezalgo = require('dezalgo') -var fs = require('fs') -var inherits = require('inherits') -var mkdirp = require('mkdirp') -var os = require('os') -var path = require('path') -var raf = require('random-access-file') -var rimraf = require('rimraf') -var Storage = require('./storage') -var thunky = require('thunky') - -var TMP = path.join(fs.existsSync('/tmp') ? '/tmp' : os.tmpDir(), 'webtorrent') - -inherits(FSStorage, Storage) - -/** - * fs-backed Storage for a torrent download. - * - * @param {Object} parsedTorrent - * @param {Object} opts - */ -function FSStorage (parsedTorrent, opts) { - var self = this - - self.tmp = opts.tmp || TMP - self.path = opts.path || path.join(self.tmp, parsedTorrent.infoHash) - - self.piecesMap = [] - self.nonExistentError = new Error('Cannot read from non-existent file') - - opts.nobuffer = true - Storage.call(self, parsedTorrent, opts) - - self.files.forEach(function (file) { - var fileStart = file.offset - var fileEnd = fileStart + file.length - - var pieceLength = file.pieceLength - var filePath = path.join(self.path, file.path) - - var openWrite = thunky(function (cb) { - var fileDir = path.dirname(filePath) - - mkdirp(fileDir, function (err) { - if (err) return cb(err) - if (self.closed) return cb(new Error('Storage closed')) - - var fd = raf(filePath) - file.fd = fd - cb(null, fd) - }) - }) - - var openRead = thunky(function (cb) { - // TODO: no need for fs.exists call, just try opening and handle error. - // fs.exists then open creates opportunity for race condition. - fs.exists(filePath, function (exists) { - if (exists) return openWrite(cb) - cb(self.nonExistentError) - }) - }) - - file.pieces.forEach(function (piece) { - var index = piece.index - - var pieceStart = index * pieceLength - var pieceEnd = pieceStart + piece.length - - var from = (fileStart < pieceStart) ? 0 : fileStart - pieceStart - var to = (fileEnd > pieceEnd) ? pieceLength : fileEnd - pieceStart - var offset = (fileStart > pieceStart) ? 0 : pieceStart - fileStart - - if (!self.piecesMap[index]) self.piecesMap[index] = [] - - self.piecesMap[index].push({ - from: from, - to: to, - offset: offset, - openWrite: openWrite, - openRead: openRead - }) - }) - }) -} - -FSStorage.prototype.readBlock = function (index, offset, length, cb) { - var self = this - cb = dezalgo(cb) - var piece = self.pieces[index] - if (!piece) return cb(new Error('invalid piece index ' + index)) - - if (piece.verified && piece.buffer) { - // piece is verified and cached in memory, so read directly from its buffer - // instead of reading from the filesystem. - return piece.readBlock(offset, length, cb) - } - - var rangeFrom = offset - var rangeTo = rangeFrom + length - - var targets = self.piecesMap[index].filter(function (target) { - return (target.to > rangeFrom && target.from < rangeTo) - }) - - if (!targets.length) return cb(new Error('no file matching the requested range?')) - - var buffers = [] - var end = targets.length - var i = 0 - - function readFromNextFile (err, buffer) { - if (err) return cb(err) - if (buffer) buffers.push(buffer) - if (i >= end) return cb(null, Buffer.concat(buffers)) - - var target = targets[i++] - - var from = target.from - var to = target.to - var offset = target.offset - - if (to > rangeTo) to = rangeTo - if (from < rangeFrom) { - offset += (rangeFrom - from) - from = rangeFrom - } - - target.openRead(function (err, file) { - if (self.closed) return - if (err) { - return err === self.nonExistentError - ? readFromNextFile(null, new Buffer(0)) - : cb(err) - } - file.read(offset, to - from, readFromNextFile) - }) - } - - readFromNextFile() -} - -// flush pieces to file once they're done and verified -FSStorage.prototype._onPieceDone = function (piece) { - var self = this - var targets = self.piecesMap[piece.index] - var end = targets.length - var i = 0 - - function done () { - Storage.prototype._onPieceDone.call(self, piece) - } - - if (!piece.buffer || self.readonly) return done() - - function writeToNextFile (err) { - if (err) return self.emit('error', err) - if (i >= end) { - // piece.buffer = null // TODO: free this memory! - return done() - } - - var target = targets[i++] - target.openWrite(function (err, file) { - if (self.closed) return - if (err) return self.emit('error', err) - file.write(target.offset, piece.buffer.slice(target.from, target.to), writeToNextFile) - }) - } - - writeToNextFile() -} - -/** - * Removes and cleans up any backing store for this storage. - */ -FSStorage.prototype.remove = function (cb) { - var self = this - if (!cb) cb = function () {} - - self.close(function (err) { - if (err) return cb(err) - var root = self.files[0].path.split(path.sep)[0] - rimraf(path.join(self.path, root), cb) - }) -} - -/** - * Closes the backing store for this storage. - */ -FSStorage.prototype.close = function (cb) { - var self = this - if (!cb) cb = function () {} - if (self.closed) return cb() - - Storage.prototype.close.call(self, function (err) { - if (err) return cb(err) - - var i = 0 - function loop (err) { - if (i >= self.files.length) return cb() - if (err) return cb(err) - var next = self.files[i++] - if (!next || !next.fd) return process.nextTick(loop) - next.fd.close(loop) - } - - process.nextTick(loop) - }) -} diff --git a/lib/load-chunk-store.js b/lib/load-chunk-store.js new file mode 100644 index 00000000..f9359350 --- /dev/null +++ b/lib/load-chunk-store.js @@ -0,0 +1,61 @@ +// TODO: publish this as a standalone module + +module.exports = loadChunkStore + +var BlockStream = require('block-stream2') +var MultiStream = require('multistream') + +function loadChunkStore (streams, store, chunkLength, cb) { + if (!Array.isArray(streams)) streams = [ streams ] + if (!cb) cb = noop + + var index = 0 + var outstandingPuts = 0 + var finished = false + + var multistream = new MultiStream(streams) + var blockstream = new BlockStream(chunkLength, { zeroPadding: false }) + + multistream + .on('error', onError) + .pipe(blockstream) + .on('data', onData) + .on('finish', onFinish) + .on('error', onError) + + function onData (chunk) { + outstandingPuts += 1 + store.put(index, chunk, function (err) { + if (err) return onError(err) + outstandingPuts -= 1 + maybeDone() + }) + index += 1 + } + + function onFinish () { + finished = true + maybeDone() + } + + function onError (err) { + cleanup() + cb(err) + } + + function maybeDone () { + if (finished && outstandingPuts === 0) { + cleanup() + cb(null) + } + } + + function cleanup () { + multistream.removeListener('error', onError) + blockstream.removeListener('data', onData) + blockstream.removeListener('finish', onFinish) + blockstream.removeListener('error', onError) + } +} + +function noop () {} diff --git a/lib/storage.js b/lib/storage.js deleted file mode 100644 index 27444ed5..00000000 --- a/lib/storage.js +++ /dev/null @@ -1,683 +0,0 @@ -module.exports = exports = Storage - -var appendTo = require('./append-to') -var BitField = require('bitfield') -var BlockStream = require('block-stream2') -var debug = require('debug')('webtorrent:storage') -var dezalgo = require('dezalgo') -var eos = require('end-of-stream') -var EventEmitter = require('events').EventEmitter -var FileStream = require('./file-stream') -var inherits = require('inherits') -var mime = require('./mime.json') -var MultiStream = require('multistream') -var once = require('once') -var path = require('path') -var sha1 = require('simple-sha1') - -var BLOCK_LENGTH = 16 * 1024 - -var BLOCK_BLANK = exports.BLOCK_BLANK = 0 -var BLOCK_RESERVED = exports.BLOCK_RESERVED = 1 -var BLOCK_WRITTEN = exports.BLOCK_WRITTEN = 2 - -function noop () {} - -inherits(Piece, EventEmitter) - -/** - * A torrent piece - * - * @param {number} index piece index - * @param {string} hash sha1 hash (hex) for this piece - * @param {Buffer|number} buffer backing buffer, or piece length if backing buffer is lazy - * @param {boolean=} noVerify skip piece verification (used when seeding a new file) - */ -function Piece (index, hash, buffer, noVerify) { - var self = this - EventEmitter.call(self) - if (!debug.enabled) self.setMaxListeners(0) - - self.index = index - self.hash = hash - self.noVerify = !!noVerify - - if (typeof buffer === 'number') { - // alloc buffer lazily - self.buffer = null - self.length = buffer - } else { - // use buffer provided - self.buffer = buffer - self.length = buffer.length - } - - self._reset() -} - -Piece.prototype.readBlock = function (offset, length, cb) { - var self = this - cb = dezalgo(cb) - if (!self.buffer || !self._verifyOffset(offset)) { - return cb(new Error('invalid block offset ' + offset)) - } - cb(null, self.buffer.slice(offset, offset + length)) -} - -Piece.prototype.writeBlock = function (offset, buffer, cb) { - var self = this - cb = dezalgo(cb) - if (!self._verifyOffset(offset) || !self._verifyBlock(offset, buffer)) { - return cb(new Error('invalid block ' + offset + ':' + buffer.length)) - } - self._lazyAllocBuffer() - - var i = offset / BLOCK_LENGTH - if (self.blocks[i] === BLOCK_WRITTEN) { - return cb(null) - } - - buffer.copy(self.buffer, offset) - self.blocks[i] = BLOCK_WRITTEN - self.blocksWritten += 1 - - if (self.blocksWritten === self.blocks.length) { - self.verify() - } - - cb(null) -} - -Piece.prototype.reserveBlock = function (endGame) { - var self = this - var len = self.blocks.length - for (var i = 0; i < len; i++) { - if ((self.blocks[i] && !endGame) || self.blocks[i] === BLOCK_WRITTEN) { - continue - } - self.blocks[i] = BLOCK_RESERVED - return { - offset: i * BLOCK_LENGTH, - length: (i === len - 1) - ? self.length - (i * BLOCK_LENGTH) - : BLOCK_LENGTH - } - } - return null -} - -Piece.prototype.cancelBlock = function (offset) { - var self = this - if (!self._verifyOffset(offset)) { - return false - } - - var i = offset / BLOCK_LENGTH - if (self.blocks[i] === BLOCK_RESERVED) { - self.blocks[i] = BLOCK_BLANK - } - - return true -} - -Piece.prototype._reset = function () { - var self = this - self.verified = false - self.blocks = new Buffer(Math.ceil(self.length / BLOCK_LENGTH)) - if (!process.browser) self.blocks.fill(0) - self.blocksWritten = 0 -} - -Piece.prototype.verify = function (buffer) { - var self = this - if (!buffer) buffer = self.buffer - if (self.verified || !buffer) { - return - } - - if (self.noVerify) { - self.verified = true - onResult() - return - } - - sha1(buffer, function (expectedHash) { - self.verified = (expectedHash === self.hash) - onResult() - }) - - function onResult () { - if (self.verified) { - self.emit('done') - } else { - self.emit('warning', new Error('piece ' + self.index + ' failed verification')) - self._reset() - } - } -} - -Piece.prototype._verifyOffset = function (offset) { - var self = this - if (offset % BLOCK_LENGTH === 0) { - return true - } else { - self.emit( - 'warning', - new Error('invalid block offset ' + offset + ', not multiple of ' + BLOCK_LENGTH) - ) - return false - } -} - -Piece.prototype._verifyBlock = function (offset, buffer) { - var self = this - if (buffer.length === BLOCK_LENGTH) { - // normal block length - return true - } else if (buffer.length === self.length - offset && - self.length - offset < BLOCK_LENGTH) { - // last block in piece is allowed to be less than block length - return true - } else { - self.emit('warning', new Error('invalid block size ' + buffer.length)) - return false - } -} - -Piece.prototype._lazyAllocBuffer = function () { - var self = this - if (!self.buffer) self.buffer = new Buffer(self.length) -} - -inherits(File, EventEmitter) - -/** - * A torrent file - * - * @param {Storage} storage Storage container object - * @param {Object} file the file object from the parsed torrent - * @param {Array.} pieces backing pieces for this file - * @param {number} pieceLength the length in bytes of a non-terminal piece - */ -function File (storage, file, pieces, pieceLength) { - var self = this - EventEmitter.call(self) - if (!debug.enabled) self.setMaxListeners(0) - - self.storage = storage - self.name = file.name - self.path = file.path - self.length = file.length - self.offset = file.offset - self.pieces = pieces - self.pieceLength = pieceLength - self.done = false - - self._blobUrl = null - self._blobUrlPending = false - - self.pieces.forEach(function (piece) { - piece.on('done', function () { - self._checkDone() - }) - }) - - // if the file is zero-length, it will be done upon initialization - self._checkDone() -} - -/** - * Selects the file to be downloaded, but at a lower priority than files with streams. - * Useful if you know you need the file at a later stage. - */ -File.prototype.select = function () { - var self = this - if (self.pieces.length > 0) { - var start = self.pieces[0].index - var end = self.pieces[self.pieces.length - 1].index - self.storage.emit('select', start, end, false) - } -} - -/** - * Deselects the file, which means it won't be downloaded unless someone creates a stream - * for it. - */ -File.prototype.deselect = function () { - var self = this - if (self.pieces.length > 0) { - var start = self.pieces[0].index - var end = self.pieces[self.pieces.length - 1].index - self.storage.emit('deselect', start, end, false) - } -} - -/** - * Create a readable stream to the file. Pieces needed by the stream will be prioritized - * highly and fetched from the swarm first. - * - * @param {Object} opts - * @param {number} opts.start stream slice of file, starting from this byte (inclusive) - * @param {number} opts.end stream slice of file, ending with this byte (inclusive) - * @return {stream.Readable} - */ -File.prototype.createReadStream = function (opts) { - var self = this - if (!opts) opts = {} - if (opts.pieceLength == null) opts.pieceLength = self.pieceLength - var stream = new FileStream(self, opts) - self.storage.emit('select', stream.startPiece, stream.endPiece, true, stream.notify.bind(stream)) - eos(stream, function () { - self.storage.emit('deselect', stream.startPiece, stream.endPiece, true) - }) - - return stream -} - -/** - * @param {function} cb - */ -File.prototype.getBuffer = function (cb) { - var self = this - cb = dezalgo(once(cb)) - - var buffer - if (self.storage.buffer) { - // Use the in-memory buffer (when possible) for better memory utilization - var onDone = function () { - buffer = self.storage.buffer.slice(self.offset, self.offset + self.length) - cb(null, buffer) - } - if (self.done) onDone() - else self.once('done', onDone) - } else { - buffer = new Buffer(self.length) - var start = 0 - self.createReadStream() - .on('data', function (chunk) { - chunk.copy(buffer, start) - start += chunk.length - }) - .on('end', function () { - cb(null, buffer) - }) - .on('error', cb) - } -} - -File.prototype.appendTo = function (elem, cb) { - var self = this - if (typeof window === 'undefined') throw new Error('browser-only method') - if (typeof elem === 'string') elem = document.querySelector(elem) - - appendTo(self, elem, cb) -} - -/** - * Note: This function is async to support different types of (async) storage backends in - * the future. - * @param {function} cb - */ -File.prototype.getBlobURL = function (cb) { - var self = this - if (typeof window === 'undefined') throw new Error('browser-only method') - cb = dezalgo(cb) - - if (self._blobUrl) return cb(null, self._blobUrl) - if (self._blobUrlPending) return self.once('_blobUrl', cb) - - self._blobUrlPending = true - - self.getBuffer(function (err, buffer) { - self._blobUrlPending = false - if (err) { - cb(err) - self.emit('_blobUrl', err) - return - } - - var type = mime[path.extname(self.name).toLowerCase()] - var blob = type - ? new window.Blob([ buffer ], { type: type }) - : new window.Blob([ buffer ]) - self._blobUrl = window.URL.createObjectURL(blob) - - cb(null, self._blobUrl) - self.emit('_blobUrl', null, self._blobUrl) - }) -} - -File.prototype._checkDone = function () { - var self = this - self.done = self.pieces.every(function (piece) { - return piece.verified - }) - - if (self.done) { - process.nextTick(function () { - self.emit('done') - }) - } -} - -inherits(Storage, EventEmitter) - -/** - * Storage for a torrent download. Handles the complexities of reading and writing - * to pieces and files. - * - * @param {Object} parsedTorrent - * @param {Object} opts - */ -function Storage (parsedTorrent, opts) { - var self = this - EventEmitter.call(self) - if (!debug.enabled) self.setMaxListeners(0) - if (!opts) opts = {} - - self.bitfield = new BitField(parsedTorrent.pieces.length) - - self.done = false - self.closed = false - self.readonly = true - - if (!opts.nobuffer) { - self.buffer = new Buffer(parsedTorrent.length) - } - - var pieceLength = self.pieceLength = parsedTorrent.pieceLength - var lastPieceLength = parsedTorrent.lastPieceLength - var numPieces = parsedTorrent.pieces.length - - self.pieces = parsedTorrent.pieces.map(function (hash, index) { - var start = index * pieceLength - var end = start + (index === numPieces - 1 ? lastPieceLength : pieceLength) - - // if we're backed by a buffer, the piece's buffer will reference the same memory. - // otherwise, the piece's buffer will be lazily created on demand - var buffer = (self.buffer ? self.buffer.slice(start, end) : end - start) - - var piece = new Piece(index, hash, buffer, !!opts.noVerify) - piece.on('done', self._onPieceDone.bind(self, piece)) - return piece - }) - - self.files = parsedTorrent.files.map(function (fileObj) { - var start = fileObj.offset - var end = start + fileObj.length - 1 - - var startPiece = start / pieceLength | 0 - var endPiece = end / pieceLength | 0 - var pieces = self.pieces.slice(startPiece, endPiece + 1) - - var file = new File(self, fileObj, pieces, pieceLength) - file.on('done', self._onFileDone.bind(self, file)) - return file - }) -} - -Storage.BLOCK_LENGTH = BLOCK_LENGTH - -Storage.prototype.load = function (streams, cb) { - var self = this - if (!Array.isArray(streams)) streams = [ streams ] - cb = once(cb || function () {}) - - var pieceIndex = 0 - var multistream = new MultiStream(streams) - var blockstream = new BlockStream(self.pieceLength, { zeroPadding: false }) - - multistream.on('error', onError) - - self.once('done', onDone) - - multistream - .pipe(blockstream) - .on('data', onData) - .on('error', onError) - - function onData (piece) { - var index = pieceIndex - pieceIndex += 1 - - var blockIndex = 0 - var s = new BlockStream(BLOCK_LENGTH, { zeroPadding: false }) - - s.on('data', onBlockData) - s.on('end', onBlockEnd) - - function onBlockData (block) { - var offset = blockIndex * BLOCK_LENGTH - blockIndex += 1 - self.writeBlock(index, offset, block) - } - - function onBlockEnd () { - blockCleanup() - } - - function blockCleanup () { - s.removeListener('data', onBlockData) - s.removeListener('end', onBlockEnd) - } - - s.end(piece) - } - - function onError (err) { - cleanup() - cb(err) - } - - function onDone () { - cleanup() - cb(null) - } - - function cleanup () { - multistream.removeListener('error', onError) - blockstream.removeListener('data', onData) - blockstream.removeListener('error', onError) - self.removeListener('done', onDone) - } -} - -Object.defineProperty(Storage.prototype, 'downloaded', { - get: function () { - var self = this - return self.pieces.reduce(function (total, piece) { - return total + (piece.verified ? piece.length : piece.blocksWritten * BLOCK_LENGTH) - }, 0) - } -}) - -/** - * The number of missing pieces. Used to implement 'end game' mode. - */ -Object.defineProperty(Storage.prototype, 'numMissing', { - get: function () { - var self = this - var numMissing = self.pieces.length - for (var index = 0, len = self.pieces.length; index < len; index++) { - numMissing -= self.bitfield.get(index) - } - return numMissing - } -}) - -/** - * Reads a block from a piece. - * - * @param {number} index piece index - * @param {number} offset byte offset within piece - * @param {number} length length in bytes to read from piece - * @param {function} cb - */ -Storage.prototype.readBlock = function (index, offset, length, cb) { - var self = this - cb = dezalgo(cb) - var piece = self.pieces[index] - if (!piece) return cb(new Error('invalid piece index ' + index)) - piece.readBlock(offset, length, cb) -} - -/** - * Writes a block to a piece. - * - * @param {number} index piece index - * @param {number} offset byte offset within piece - * @param {Buffer} buffer buffer to write - * @param {function} cb - */ -Storage.prototype.writeBlock = function (index, offset, buffer, cb) { - var self = this - if (!cb) cb = noop - cb = dezalgo(cb) - - if (self.readonly) return cb(new Error('cannot write to readonly storage')) - var piece = self.pieces[index] - if (!piece) return cb(new Error('invalid piece index ' + index)) - piece.writeBlock(offset, buffer, cb) -} - -/** - * Reads a piece or a range of a piece. - * - * @param {number} index piece index - * @param {Object=} range optional range within piece - * @param {number} range.offset byte offset within piece - * @param {number} range.length length in bytes to read from piece - * @param {function} cb - * @param {boolean} force optionally overrides default check preventing reading - * from unverified piece - */ -Storage.prototype.read = function (index, range, cb, force) { - var self = this - - if (typeof range === 'function') { - force = cb - cb = range - range = null - } - cb = dezalgo(cb) - - var piece = self.pieces[index] - if (!piece) { - return cb(new Error('invalid piece index ' + index)) - } - - if (!piece.verified && !force) { - return cb(new Error('Storage.read called on incomplete piece ' + index)) - } - - var offset = 0 - var length = piece.length - - if (range) { - offset = range.offset || 0 - length = range.length || length - } - - if (piece.buffer) { - // shortcut for piece with static backing buffer - return cb(null, piece.buffer.slice(offset, offset + length)) - } - - var blocks = [] - function readNextBlock () { - if (length <= 0) return cb(null, Buffer.concat(blocks)) - - var blockOffset = offset - var blockLength = Math.min(BLOCK_LENGTH, length) - - offset += blockLength - length -= blockLength - - self.readBlock(index, blockOffset, blockLength, function (err, block) { - if (err) return cb(err) - - blocks.push(block) - readNextBlock() - }) - } - - readNextBlock() -} - -/** - * Reserves a block from the given piece. - * - * @param {number} index piece index - * @param {Boolean} endGame whether or not end game mode is enabled - * - * @returns {Object|null} reservation with offset and length or null if failed. - */ -Storage.prototype.reserveBlock = function (index, endGame) { - var self = this - var piece = self.pieces[index] - if (!piece) return null - - return piece.reserveBlock(endGame) -} - -/** - * Cancels a previous block reservation from the given piece. - * - * @param {number} index piece index - * @param {number} offset byte offset of block in piece - * - * @returns {Boolean} - */ -Storage.prototype.cancelBlock = function (index, offset) { - var self = this - var piece = self.pieces[index] - if (!piece) return false - - return piece.cancelBlock(offset) -} - -/** - * Removes and cleans up any backing store for this storage. - * @param {function=} cb - */ -Storage.prototype.remove = function (cb) { - if (cb) dezalgo(cb)(null) -} - -/** - * Closes the backing store for this storage. - * @param {function=} cb - */ -Storage.prototype.close = function (cb) { - var self = this - self.closed = true - if (cb) dezalgo(cb)(null) -} - -// -// HELPER METHODS -// - -Storage.prototype._onPieceDone = function (piece) { - var self = this - self.bitfield.set(piece.index) - debug('piece done ' + piece.index + ' (' + self.numMissing + ' still missing)') - self.emit('piece', piece) -} - -Storage.prototype._onFileDone = function (file) { - var self = this - debug('file done ' + file.name) - self.emit('file', file) - - self._checkDone() -} - -Storage.prototype._checkDone = function () { - var self = this - - if (!self.done && self.files.every(function (file) { return file.done })) { - self.done = true - self.emit('done') - } -} diff --git a/lib/torrent.js b/lib/torrent.js index eff64331..8d5b8f3a 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1,28 +1,38 @@ module.exports = Torrent var addrToIPPort = require('addr-to-ip-port') // browser exclude +var BitField = require('bitfield') var createTorrent = require('create-torrent') var debug = require('debug')('webtorrent:torrent') var Discovery = require('torrent-discovery') var EventEmitter = require('events').EventEmitter +var extend = require('xtend/mutable') +var FSChunkStore = require('fs-chunk-store') +var ImmediateChunkStore = require('immediate-chunk-store') var inherits = require('inherits') +var os = require('os') var parallel = require('run-parallel') var parseTorrent = require('parse-torrent') +var path = require('path') +var pathExists = require('path-exists') +var Piece = require('torrent-piece') var randomIterate = require('random-iterate') var reemit = require('re-emitter') +var sha1 = require('simple-sha1') var Swarm = require('bittorrent-swarm') var uniq = require('uniq') var ut_metadata = require('ut_metadata') var ut_pex = require('ut_pex') // browser exclude +var File = require('./file') +var loadChunkStore = require('./load-chunk-store') var RarityMap = require('./rarity-map') var Server = require('./server') // browser exclude -var Storage = require('./storage') var MAX_BLOCK_LENGTH = 128 * 1024 var PIECE_TIMEOUT = 30000 var CHOKE_TIMEOUT = 5000 -var SPEED_THRESHOLD = 3 * Storage.BLOCK_LENGTH +var SPEED_THRESHOLD = 3 * Piece.BLOCK_LENGTH var PIPELINE_MIN_DURATION = 0.5 var PIPELINE_MAX_DURATION = 1 @@ -30,13 +40,11 @@ var PIPELINE_MAX_DURATION = 1 var RECHOKE_INTERVAL = 10000 // 10 seconds var RECHOKE_OPTIMISTIC_DURATION = 2 // 30 seconds -function noop () {} +var TMP = path.join(pathExists.sync('/tmp') ? '/tmp' : os.tmpDir(), 'webtorrent') inherits(Torrent, EventEmitter) /** - * A torrent - * * @param {string|Buffer|Object} torrentId * @param {Object} opts */ @@ -46,14 +54,14 @@ function Torrent (torrentId, opts) { if (!debug.enabled) self.setMaxListeners(0) debug('new torrent') - self.opts = opts self.client = opts.client - self.hotswapEnabled = ('hotswap' in opts ? opts.hotswap : true) - self.verify = opts.verify + self.announce = opts.announce + self.urlList = opts.urlList + + self._path = opts.path + self._storage = opts.storage || FSChunkStore - self.chokeTimeout = opts.chokeTimeout || CHOKE_TIMEOUT - self.pieceTimeout = opts.pieceTimeout || PIECE_TIMEOUT self.strategy = opts.strategy || 'sequential' self._rechokeNumSlots = (opts.uploads === false || opts.uploads === 0) @@ -63,32 +71,24 @@ function Torrent (torrentId, opts) { self._rechokeOptimisticTime = 0 self._rechokeIntervalId = null - self.infoHash = null self.ready = false self.destroyed = false - self.files = [] self.metadata = null - self.parsedTorrent = null self.storage = null self.numBlockedPeers = 0 + self.files = null + self._amInterested = false self._selections = [] self._critical = [] - self._storageImpl = opts.storage || Storage - this._torrentFileURL = null + + // for cleanup self._servers = [] if (torrentId) self._onTorrentId(torrentId) } -// torrent size (in bytes) -Object.defineProperty(Torrent.prototype, 'length', { - get: function () { - return (this.parsedTorrent && this.parsedTorrent.length) || 0 - } -}) - -// time remaining (in milliseconds) +// Time remaining (in milliseconds) Object.defineProperty(Torrent.prototype, 'timeRemaining', { get: function () { if (this.swarm.downloadSpeed() === 0) return Infinity @@ -96,60 +96,62 @@ Object.defineProperty(Torrent.prototype, 'timeRemaining', { } }) -// percentage complete, represented as a number between 0 and 1 -Object.defineProperty(Torrent.prototype, 'progress', { - get: function () { - return (this.parsedTorrent && (this.downloaded / this.parsedTorrent.length)) || 0 - } -}) - -// bytes downloaded (not necessarily verified) +// Bytes downloaded Object.defineProperty(Torrent.prototype, 'downloaded', { - get: function () { - return (this.storage && this.storage.downloaded) || 0 - } + get: function () { return this.swarm ? this.swarm.downloaded : 0 } }) -// bytes uploaded +// Bytes uploaded Object.defineProperty(Torrent.prototype, 'uploaded', { - get: function () { - return this.swarm.uploaded - } + get: function () { return this.swarm ? this.swarm.uploaded : 0 } }) -// ratio of bytes downloaded to uploaded -Object.defineProperty(Torrent.prototype, 'ratio', { - get: function () { - return (this.uploaded && (this.downloaded / this.uploaded)) || 0 - } +// TODO: add this and use it for "progress" property +// Object.defineProperty(Torrent.prototype, 'verified', { +// get: function () { +// var self = this +// return self.pieces.reduce(function (total, piece) { +// return total + (piece.verified ? piece.length : piece.blocksWritten * BLOCK_LENGTH) +// }, 0) +// } +// }) + +/** + * The number of missing pieces. Used to implement 'end game' mode. + */ +// Object.defineProperty(Storage.prototype, 'numMissing', { +// get: function () { +// var self = this +// var numMissing = self.pieces.length +// for (var index = 0, len = self.pieces.length; index < len; index++) { +// numMissing -= self.bitfield.get(index) +// } +// return numMissing +// } +// }) + +// Percentage complete, represented as a number between 0 and 1 +Object.defineProperty(Torrent.prototype, 'progress', { + get: function () { return this.length ? this.downloaded / this.length : 0 } }) -Object.defineProperty(Torrent.prototype, 'magnetURI', { - get: function () { - return parseTorrent.toMagnetURI(this.parsedTorrent) - } +// Seed ratio +Object.defineProperty(Torrent.prototype, 'ratio', { + get: function () { return this.uploaded / (this.downloaded || 1) } }) -Object.defineProperty(Torrent.prototype, 'torrentFile', { - get: function () { - return parseTorrent.toTorrentFile(this.parsedTorrent) - } +// Number of peers +Object.defineProperty(Torrent.prototype, 'numPeers', { + get: function () { return this.swarm ? this.swarm.numPeers : 0 } }) Object.defineProperty(Torrent.prototype, 'torrentFileURL', { get: function () { if (typeof window === 'undefined') throw new Error('browser-only property') - if (this._torrentFileURL) return this._torrentFileURL - this._torrentFileURL = window.URL.createObjectURL( + if (!this.torrentFile) return null + return window.URL.createObjectURL( new window.Blob([ this.torrentFile ], { type: 'application/x-bittorrent' }) ) - return this._torrentFileURL - } -}) - -Object.defineProperty(Torrent.prototype, 'numPeers', { - get: function () { - return this.swarm ? this.swarm.numPeers : 0 } }) @@ -179,35 +181,14 @@ Torrent.prototype._onTorrentId = function (torrentId) { Torrent.prototype._onParsedTorrent = function (parsedTorrent) { var self = this if (self.destroyed) return - self.parsedTorrent = parsedTorrent - self.infoHash = parsedTorrent.infoHash - - if (!self.infoHash) { - return self._onError(new Error('Malformed torrent data: Missing info hash.')) - } - - if (self.parsedTorrent.name) self.name = self.parsedTorrent.name // preliminary name - // Allow specifying trackers via `opts` parameter - if (self.opts.announce) { - self.parsedTorrent.announce = - self.parsedTorrent.announce.concat(self.opts.announce) - } + self._processParsedTorrent(parsedTorrent) - // So `webtorrent-hybrid` can force specific trackers to be used - if (global.WEBTORRENT_ANNOUNCE) { - self.parsedTorrent.announce = - self.parsedTorrent.announce.concat(global.WEBTORRENT_ANNOUNCE) - } - - // When no trackers specified, use some reasonable defaults - if (self.parsedTorrent.announce.length === 0) { - self.parsedTorrent.announce = createTorrent.announceList.map(function (list) { - return list[0] - }) + if (!self.infoHash) { + return self._onError(new Error('Malformed torrent data: No info hash')) } - uniq(self.parsedTorrent.announce) + if (!self._path) self._path = path.join(TMP, self.infoHash) // create swarm self.swarm = new Swarm(self.infoHash, self.client.peerId, { @@ -238,6 +219,37 @@ Torrent.prototype._onParsedTorrent = function (parsedTorrent) { }) } +Torrent.prototype._processParsedTorrent = function (parsedTorrent) { + if (this.announce) { + // Allow specifying trackers via `opts` parameter + parsedTorrent.announce = parsedTorrent.announce.concat(this.announce) + } + + if (global.WEBTORRENT_ANNOUNCE) { + // So `webtorrent-hybrid` can force specific trackers to be used + parsedTorrent.announce = parsedTorrent.announce.concat(global.WEBTORRENT_ANNOUNCE) + } + + if (parsedTorrent.announce.length === 0) { + // When no trackers specified, use some reasonable defaults + parsedTorrent.announce = createTorrent.announceList.map(function (list) { + return list[0] + }) + } + + if (this.urlList) { + // Allow specifying web seeds via `opts` parameter + parsedTorrent.urlList = parsedTorrent.urlList.concat(this.urlList) + } + + uniq(parsedTorrent.announce) + + extend(this, parsedTorrent) + + this.magnetURI = parseTorrent.toMagnetURI(parsedTorrent) + this.torrentFile = parseTorrent.toTorrentFile(parsedTorrent) +} + Torrent.prototype._onSwarmListening = function () { var self = this if (self.destroyed) return @@ -246,7 +258,7 @@ Torrent.prototype._onSwarmListening = function () { // begin discovering peers via the DHT and tracker servers self.discovery = new Discovery({ - announce: self.parsedTorrent.announce, + announce: self.announce, dht: self.client.dht, tracker: self.client.tracker, peerId: self.client.peerId, @@ -262,74 +274,73 @@ Torrent.prototype._onSwarmListening = function () { reemit(self.discovery, self, ['trackerAnnounce', 'dhtAnnounce', 'warning']) // if full metadata was included in initial torrent id, use it - if (self.parsedTorrent.info) self._onMetadata(self.parsedTorrent) + if (self.info) self._onMetadata(self) self.emit('listening', self.client.torrentPort) } /** - * Called when the metadata is received. + * Called when the full torrent metadata is received. */ Torrent.prototype._onMetadata = function (metadata) { var self = this if (self.metadata || self.destroyed) return debug('got metadata') + var parsedTorrent if (metadata && metadata.infoHash) { // `metadata` is a parsed torrent (from parse-torrent module) - self.metadata = parseTorrent.toTorrentFile(metadata) - self.parsedTorrent = metadata + parsedTorrent = metadata } else { - self.metadata = metadata - var announce = self.parsedTorrent.announce - var urlList = self.parsedTorrent.urlList try { - self.parsedTorrent = parseTorrent(self.metadata) + parsedTorrent = parseTorrent(metadata) } catch (err) { return self._onError(err) } - self.parsedTorrent.announce = announce - self.parsedTorrent.urlList = urlList } - // update preliminary torrent name - self.name = self.parsedTorrent.name + self._processParsedTorrent(parsedTorrent) + self.metadata = self.torrentFile // update discovery module with full torrent metadata - self.discovery.setTorrent(self.parsedTorrent) + self.discovery.setTorrent(self) // add web seed urls (BEP19) - if (self.parsedTorrent.urlList) { - self.parsedTorrent.urlList.forEach(self.addWebSeed.bind(self)) - } + if (self.urlList) self.urlList.forEach(self.addWebSeed.bind(self)) - self.rarityMap = new RarityMap(self.swarm, self.parsedTorrent.pieces.length) + self.rarityMap = new RarityMap(self.swarm, self.pieces.length) - self.storage = new self._storageImpl(self.parsedTorrent, self.opts) - self.storage.on('piece', self._onStoragePiece.bind(self)) - self.storage.on('file', function (file) { - self.emit('file', file) - }) + self.storage = new ImmediateChunkStore( + new self._storage(self.pieceLength, { + files: self.files.map(function (file) { + return { + path: path.join(self._path, file.path), + length: file.length, + offset: file.offset + } + }) + }) + ) - self._reservations = self.storage.pieces.map(function () { - return [] + self.files = self.files.map(function (file) { + return new File(self, file) }) - self.storage.on('done', function () { - if (self.discovery.tracker) self.discovery.tracker.complete() + self._hashes = self.pieces - debug('torrent ' + self.infoHash + ' done') - self.emit('done') + self.pieces = self.pieces.map(function (hash, i) { + var pieceLength = (i === self.pieces.length - 1) + ? self.lastPieceLength + : self.pieceLength + return new Piece(pieceLength) }) - self.storage.on('select', self.select.bind(self)) - self.storage.on('deselect', self.deselect.bind(self)) - self.storage.on('critical', self.critical.bind(self)) - - self.storage.files.forEach(function (file) { - self.files.push(file) + self._reservations = self.pieces.map(function () { + return [] }) + self.bitfield = new BitField(self.pieces.length) + self.swarm.wires.forEach(function (wire) { // If we didn't have the metadata at the time ut_metadata was initialized for this // wire, we still want to make it available to the peer in case they request it. @@ -338,43 +349,64 @@ Torrent.prototype._onMetadata = function (metadata) { self._onWireWithMetadata(wire) }) - if (self.verify) { - process.nextTick(function () { - debug('verifying existing torrent data') - var numPieces = 0 - var numVerified = 0 - - // TODO: move storage verification to storage.js? - parallel(self.storage.pieces.map(function (piece) { - return function (cb) { - self.storage.read(piece.index, function (err, buffer) { - numPieces += 1 - self.emit('verifying', { - percentDone: 100 * numPieces / self.storage.pieces.length, - percentVerified: 100 * numVerified / self.storage.pieces.length - }) - - if (!err && buffer) { - // TODO: this is a bit hacky; figure out a cleaner way of verifying the buffer - piece.verify(buffer) - numVerified += piece.verified - debug('piece ' + (piece.verified ? 'verified' : 'invalid') + ' ' + piece.index) - } - // continue regardless of whether piece verification failed - cb() - }, true) // forces override to allow reading from non-verified pieces - } - }), self._onStorage.bind(self)) - }) - } else { - process.nextTick(self._onStorage.bind(self)) - } + // VERIFY TORRENT DATA + // TODO: remove nextTick + // process.nextTick(function () { + // debug('verifying existing torrent data') + // var numPieces = 0 + // var numVerified = 0 + + // // TODO: move storage verification to storage.js? + // parallel(self.storage.pieces.map(function (piece) { + // return function (cb) { + // self.storage.read(piece.index, function (err, buffer) { + // numPieces += 1 + // self.emit('verifying', { + // percentDone: 100 * numPieces / self.storage.pieces.length, + // percentVerified: 100 * numVerified / self.storage.pieces.length + // }) + + // if (!err && buffer) { + // // TODO: this is a bit hacky; figure out a cleaner way of verifying the buffer + // piece.verify(buffer) + // numVerified += piece.verified + // debug('piece ' + (piece.verified ? 'verified' : 'invalid') + ' ' + piece.index) + // } + // // continue regardless of whether piece verification failed + // cb() + // }, true) // forces override to allow reading from non-verified pieces + // } + // }), self._onStorage.bind(self)) + // }) + process.nextTick(function () { + self._onStorage() + }) process.nextTick(function () { self.emit('metadata') }) } +/** + * Called when the metadata, swarm, and underlying storage are all fully initialized. + */ +Torrent.prototype._onStorage = function () { + var self = this + if (self.destroyed) return + debug('on storage') + + // start off selecting the entire torrent with low priority + self.select(0, self.pieces.length - 1, false) + + self._rechokeIntervalId = setInterval(self._rechoke.bind(self), RECHOKE_INTERVAL) + if (self._rechokeIntervalId.unref) self._rechokeIntervalId.unref() + + process.nextTick(function () { + self.ready = true + self.emit('ready') + }) +} + /** * Destroy and cleanup this torrent. */ @@ -391,11 +423,6 @@ Torrent.prototype.destroy = function (cb) { self._rechokeIntervalId = null } - self.files.forEach(function (file) { - if (file._blobURL) window.URL.revokeObjectURL(file._blobURL) - }) - if (self._torrentFileURL) window.URL.revokeObjectURL(self._torrentFileURL) - var tasks = [] self._servers.forEach(function (server) { @@ -441,7 +468,7 @@ Torrent.prototype.addPeer = function (peer) { */ Torrent.prototype.addWebSeed = function (url) { var self = this - self.swarm.addWebSeed(url, self.parsedTorrent) + self.swarm.addWebSeed(url, self) } /** @@ -454,7 +481,7 @@ Torrent.prototype.addWebSeed = function (url) { */ Torrent.prototype.select = function (start, end, priority, notify) { var self = this - if (start > end || start < 0 || end >= self.storage.pieces.length) { + if (start > end || start < 0 || end >= self.pieces.length) { throw new Error('invalid selection ', start, ':', end) } priority = Number(priority) || 0 @@ -549,7 +576,7 @@ Torrent.prototype._onWire = function (wire, addr) { }) // Timeout for piece requests to this peer - wire.setTimeout(self.pieceTimeout, true) + wire.setTimeout(PIECE_TIMEOUT, true) // Send KEEP-ALIVE (every 60s) so peers will not disconnect the wire wire.setKeepAlive(true) @@ -598,7 +625,6 @@ Torrent.prototype._onWire = function (wire, addr) { Torrent.prototype._onWireWithMetadata = function (wire) { var self = this var timeoutId = null - var timeoutMs = self.chokeTimeout function onChokeTimeout () { if (self.destroyed || wire.destroyed) return @@ -607,15 +633,15 @@ Torrent.prototype._onWireWithMetadata = function (wire) { wire.amInterested) { wire.destroy() } else { - timeoutId = setTimeout(onChokeTimeout, timeoutMs) + timeoutId = setTimeout(onChokeTimeout, CHOKE_TIMEOUT) if (timeoutId.unref) timeoutId.unref() } } var i = 0 function updateSeedStatus () { - if (wire.peerPieces.length !== self.storage.pieces.length) return - for (; i < self.storage.pieces.length; ++i) { + if (wire.peerPieces.length !== self.pieces.length) return + for (; i < self.pieces.length; ++i) { if (!wire.peerPieces.get(i)) return } wire.isSeeder = true @@ -642,7 +668,7 @@ Torrent.prototype._onWireWithMetadata = function (wire) { wire.on('choke', function () { clearTimeout(timeoutId) - timeoutId = setTimeout(onChokeTimeout, timeoutMs) + timeoutId = setTimeout(onChokeTimeout, CHOKE_TIMEOUT) if (timeoutId.unref) timeoutId.unref() }) @@ -652,67 +678,24 @@ Torrent.prototype._onWireWithMetadata = function (wire) { }) wire.on('request', function (index, offset, length, cb) { - // Disconnect from peers that request more than 128KB, per spec if (length > MAX_BLOCK_LENGTH) { - debug( - 'got invalid block size request %s (from %s)', - length, wire.remoteAddress + ':' + wire.remotePort - ) + // Per spec, disconnect from peers that request >128KB return wire.destroy() } - - self.storage.readBlock(index, offset, length, cb) + if (self.pieces[index]) return + self.storage.get(index, { offset: offset, length: length }, cb) }) - wire.bitfield(self.storage.bitfield) // always send bitfield (required) + wire.bitfield(self.bitfield) // always send bitfield (required) wire.interested() // always start out interested - timeoutId = setTimeout(onChokeTimeout, timeoutMs) + timeoutId = setTimeout(onChokeTimeout, CHOKE_TIMEOUT) if (timeoutId.unref) timeoutId.unref() wire.isSeeder = false updateSeedStatus() } -/** - * Called when the metadata, swarm, and underlying storage are all fully initialized. - */ -Torrent.prototype._onStorage = function () { - var self = this - if (self.destroyed) return - debug('on storage') - - // allow writes to storage only after initial piece verification is finished - self.storage.readonly = false - - // start off selecting the entire torrent with low priority - self.select(0, self.storage.pieces.length - 1, false) - - self._rechokeIntervalId = setInterval(self._rechoke.bind(self), RECHOKE_INTERVAL) - if (self._rechokeIntervalId.unref) self._rechokeIntervalId.unref() - - process.nextTick(function () { - self.ready = true - self.emit('ready') - }) -} - -/** - * When a piece is fully downloaded, notify all peers with a HAVE message. - * @param {Piece} piece - */ -Torrent.prototype._onStoragePiece = function (piece) { - var self = this - debug('piece done %s', piece.index) - self._reservations[piece.index] = null - - self.swarm.wires.forEach(function (wire) { - wire.have(piece.index) - }) - - self._gcSelections() -} - /** * Called on selection changes. */ @@ -737,13 +720,13 @@ Torrent.prototype._gcSelections = function () { var oldOffset = s.offset // check for newly downloaded pieces in selection - while (self.storage.bitfield.get(s.from + s.offset) && s.from + s.offset < s.to) { + while (self.bitfield.get(s.from + s.offset) && s.from + s.offset < s.to) { s.offset++ } if (oldOffset !== s.offset) s.notify() if (s.to !== s.from + s.offset) continue - if (!self.storage.bitfield.get(s.from + s.offset)) continue + if (!self.bitfield.get(s.from + s.offset)) continue // remove fully downloaded selection self._selections.splice(i--, 1) // decrement i to offset splice @@ -816,7 +799,6 @@ Torrent.prototype._updateWire = function (wire) { for (var i = self._selections.length; i--;) { var next = self._selections[i] - var piece if (self.strategy === 'rarest') { var start = next.from + next.offset @@ -849,15 +831,14 @@ Torrent.prototype._updateWire = function (wire) { var speed = wire.downloadSpeed() || 1 if (speed > SPEED_THRESHOLD) return function () { return true } - var secs = Math.max(1, wire.requests.length) * Storage.BLOCK_LENGTH / speed + var secs = Math.max(1, wire.requests.length) * Piece.BLOCK_LENGTH / speed var tries = 10 var ptr = 0 return function (index) { - if (!tries || self.storage.bitfield.get(index)) return true + if (!tries || self.bitfield.get(index)) return true - var piece = self.storage.pieces[index] - var missing = piece.blocks.length - piece.blocksWritten + var missing = self.pieces[index].missing for (; ptr < self.swarm.wires.length; ptr++) { var otherWire = self.swarm.wires[ptr] @@ -1017,10 +998,9 @@ Torrent.prototype._rechoke = function () { */ Torrent.prototype._hotswap = function (wire, index) { var self = this - if (!self.hotswapEnabled) return false var speed = wire.downloadSpeed() - if (speed < Storage.BLOCK_LENGTH) return false + if (speed < Piece.BLOCK_LENGTH) return false if (!self._reservations[index]) return false var r = self._reservations[index] @@ -1054,7 +1034,7 @@ Torrent.prototype._hotswap = function (wire, index) { var req = minWire.requests[i] if (req.piece !== index) continue - self.storage.cancelBlock(index, req.offset) + self.pieces[index].cancel((req.offset / Piece.BLOCK_SIZE) | 0) } self.emit('hotswap', minWire, wire, index) @@ -1068,66 +1048,121 @@ Torrent.prototype._request = function (wire, index, hotswap) { var self = this var numRequests = wire.requests.length - if (self.storage.bitfield.get(index)) return false + if (self.bitfield.get(index)) return false + var maxOutstandingRequests = getPipelineLength(wire, PIPELINE_MAX_DURATION) if (numRequests >= maxOutstandingRequests) return false + // var endGame = (wire.requests.length === 0 && self.storage.numMissing < 30) - var endGame = (wire.requests.length === 0 && self.storage.numMissing < 30) - var block = self.storage.reserveBlock(index, endGame) + var piece = self.pieces[index] + var reservation = piece.reserve() - if (!block && !endGame && hotswap && self._hotswap(wire, index)) { - block = self.storage.reserveBlock(index, false) + if (reservation === -1 && hotswap && self._hotswap(wire, index)) { + reservation = piece.reserve() } - if (!block) return false + if (reservation === -1) return false var r = self._reservations[index] - if (!r) { - r = self._reservations[index] = [] - } + if (!r) r = self._reservations[index] = [] var i = r.indexOf(null) if (i === -1) i = r.length r[i] = wire - function gotPiece (err, buffer) { - if (!self.ready) { - self.once('ready', function () { - gotPiece(err, buffer) - }) - return - } + var chunkOffset = piece.chunkOffset(reservation) + var chunkLength = piece.chunkLength(reservation) + + wire.request(index, chunkOffset, chunkLength, function onChunk (err, chunk) { + // TODO: what is this for? + if (!self.ready) return self.once('ready', function () { onChunk(err, chunk) }) if (r[i] === wire) r[i] = null + if (piece !== self.pieces[index]) return onUpdateTick() + if (err) { debug( 'error getting piece %s (offset: %s length: %s) from %s: %s', - index, block.offset, block.length, wire.remoteAddress + ':' + wire.remotePort, + index, chunkOffset, chunkLength, wire.remoteAddress + ':' + wire.remotePort, err.message ) - self.storage.cancelBlock(index, block.offset) - process.nextTick(self._update.bind(self)) - return false - } else { - debug( - 'got piece %s (offset: %s length: %s) from %s', - index, block.offset, block.length, wire.remoteAddress + ':' + wire.remotePort - ) - self.storage.writeBlock(index, block.offset, buffer, function (err) { - if (err) { - debug('error writing block') - self.storage.cancelBlock(index, block.offset) + piece.cancel(reservation) + onUpdateTick() + return + } + + debug( + 'got piece %s (offset: %s length: %s) from %s', + index, chunkOffset, chunkLength, wire.remoteAddress + ':' + wire.remotePort + ) + + if (!piece.set(reservation, chunk, wire)) return onUpdateTick() + + var buf = piece.flush() + + // TODO: might need to set self.pieces[index] = null here since sha1 is async + + sha1(buf, function (hash) { + if (hash === self._hashes[index]) { + if (!self.pieces[index]) return + debug('piece verified %s', index) + + self.pieces[index] = null + self._reservations[index] = null + + self.bitfield.set(index, true) + self.storage.put(index, buf) + + self.swarm.wires.forEach(function (wire) { + wire.have(index) + }) + + // are any new files done? + self.files.forEach(function (file) { + if (file.done) return + for (var i = file._startPiece; i <= file._endPiece; ++i) { + if (!self.bitfield.get(i)) return + } + file.done = true + file.emit('done') + debug('file done: ' + file.name) + }) + + // is the torrent done? + if (self.files.every(function (file) { return file.done })) { + self.done = true + self.emit('done') + debug('torrent done: ' + self.infoHash) + if (self.discovery.tracker) self.discovery.tracker.complete() } - process.nextTick(self._update.bind(self)) - }) - } - } + self._gcSelections() + } else { + self.pieces[index] = new Piece(piece.length) + self.emit('warning', new Error('Piece ' + index + ' failed verification')) + } + onUpdateTick() + }) + }) - wire.request(index, block.offset, block.length, gotPiece) + function onUpdateTick () { + process.nextTick(function () { self._update() }) + } return true } +Torrent.prototype.load = function (streams, cb) { + var self = this + loadChunkStore(streams, this.storage, Piece.BLOCK_LENGTH, function (err) { + if (err) return cb(err) + self.pieces.forEach(function (piece, index) { + self.pieces[index] = null + self.bitfield.set(index, true) + }) + cb(null) + }) +} + Torrent.prototype.createServer = function (opts) { var self = this if (typeof Server === 'function' /* browser exclude */) { @@ -1145,7 +1180,7 @@ Torrent.prototype._onError = function (err) { } function getPipelineLength (wire, duration) { - return Math.ceil(2 + duration * wire.downloadSpeed() / Storage.BLOCK_LENGTH) + return Math.ceil(2 + duration * wire.downloadSpeed() / Piece.BLOCK_LENGTH) } /** @@ -1154,3 +1189,5 @@ function getPipelineLength (wire, duration) { function randomInt (high) { return Math.random() * high | 0 } + +function noop () {} diff --git a/package.json b/package.json index 0c03eaf1..c0569817 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,9 @@ "webtorrent": "./bin/cmd.js" }, "browser": { - "./lib/fs-storage": false, "./lib/server": false, "bittorrent-dht/client": false, + "fs-chunk-store": "memory-chunk-store", "load-ip-set": false, "ut_pex": false }, @@ -32,10 +32,13 @@ "dezalgo": "^1.0.1", "end-of-stream": "^1.0.0", "executable": "^1.1.0", + "fs-chunk-store": "^1.3.1", "hat": "0.0.3", + "immediate-chunk-store": "^1.0.7", "inherits": "^2.0.1", "inquirer": "^0.8.0", "load-ip-set": "^1.0.3", + "memory-chunk-store": "^1.1.2", "mime": "^1.2.11", "minimist": "^1.1.0", "mkdirp": "^0.5.0", @@ -44,6 +47,7 @@ "network-address": "^1.0.0", "once": "^1.3.1", "parse-torrent": "^5.1.0", + "path-exists": "^1.0.0", "pretty-bytes": "^2.0.1", "pump": "^1.0.0", "random-access-file": "^0.3.1", @@ -56,6 +60,7 @@ "speedometer": "^0.1.2", "thunky": "^0.1.0", "torrent-discovery": "^3.0.0", + "torrent-piece": "^1.0.0", "uniq": "^1.0.1", "ut_metadata": "^2.1.0", "ut_pex": "^1.0.1", diff --git a/test/download-dht-magnet.js b/test/download-dht-magnet.js index 3c05b305..93e95345 100644 --- a/test/download-dht-magnet.js +++ b/test/download-dht-magnet.js @@ -55,7 +55,7 @@ test('Download using DHT (via magnet uri)', function (t) { maybeDone() }) - torrent.storage.load(fs.createReadStream(leavesPath), function (err) { + torrent.load(fs.createReadStream(leavesPath), function (err) { t.error(err) wroteStorage = true maybeDone() diff --git a/test/download-dht-torrent.js b/test/download-dht-torrent.js index 63f90bde..cda235ae 100644 --- a/test/download-dht-torrent.js +++ b/test/download-dht-torrent.js @@ -55,7 +55,7 @@ test('Download using DHT (via .torrent file)', function (t) { maybeDone(null) }) - torrent.storage.load(fs.createReadStream(leavesPath), function (err) { + torrent.load(fs.createReadStream(leavesPath), function (err) { wroteStorage = true maybeDone(err) }) diff --git a/test/download-tracker-magnet.js b/test/download-tracker-magnet.js index 079c1628..43ed3931 100644 --- a/test/download-tracker-magnet.js +++ b/test/download-tracker-magnet.js @@ -66,7 +66,7 @@ function magnetDownloadTest (t, serverType) { t.deepEqual(torrent.files.map(function (file) { return file.name }), names) - torrent.storage.load(fs.createReadStream(leavesPath), function (err) { + torrent.load(fs.createReadStream(leavesPath), function (err) { cb(err, client1) }) }) diff --git a/test/download-tracker-torrent.js b/test/download-tracker-torrent.js index 3c9a8be9..c724f0a8 100644 --- a/test/download-tracker-torrent.js +++ b/test/download-tracker-torrent.js @@ -66,7 +66,7 @@ function torrentDownloadTest (t, serverType) { t.deepEqual(torrent.files.map(function (file) { return file.name }), names) - torrent.storage.load(fs.createReadStream(leavesPath), function (err) { + torrent.load(fs.createReadStream(leavesPath), function (err) { cb(err, client1) }) }) diff --git a/test/server.js b/test/server.js index 920637af..3a3cd364 100644 --- a/test/server.js +++ b/test/server.js @@ -29,6 +29,6 @@ test('start http server programmatically', function (t) { }) }) torrent.on('ready', function () { - torrent.storage.load(fs.createReadStream(leavesPath)) + torrent.load(fs.createReadStream(leavesPath)) }) }) diff --git a/test/storage.js b/test/storage.js deleted file mode 100644 index 15c39875..00000000 --- a/test/storage.js +++ /dev/null @@ -1,61 +0,0 @@ -var fs = require('fs') -var parseTorrent = require('parse-torrent') -var Storage = require('../lib/storage') -var test = require('tape') - -var torrents = [ 'leaves', 'pride' ].map(function (name) { - var torrent = fs.readFileSync(__dirname + '/torrents/' + name + '.torrent') - - return { - name: name, - torrent: torrent, - parsedTorrent: parseTorrent(torrent) - } -}) - -torrents.forEach(function (torrent) { - test('sanity check backing storage for ' + torrent.name + ' torrent', function (t) { - var parsedTorrent = torrent.parsedTorrent - var storage = new Storage(parsedTorrent) - - t.equal(storage.files.length, parsedTorrent.files.length) - t.equal(storage.pieces.length, parsedTorrent.pieces.length) - - var length = 0 - var pieces = 0 - - storage.pieces.forEach(function (piece) { - t.notOk(piece.verified) - length += piece.length - - // ensure all blocks start out empty - for (var i = 0; i < piece.blocks.length; ++i) { - t.equal(piece.blocks[i], 0) - } - }) - - t.equal(length, parsedTorrent.length) - length = 0 - - storage.files.forEach(function (file) { - t.notOk(file.done) - length += file.length - pieces += file.pieces.length - - t.assert(file.length >= 0) - t.assert(file.pieces.length >= 0) - }) - - t.equal(length, parsedTorrent.length) - - if (parsedTorrent.files.length > 1) { - // if the torrent contains multiple files, the pieces may overlap file boundaries, - // so the aggregate number of file pieces will be at least the number of pieces. - t.assert(pieces >= parsedTorrent.pieces.length) - } else { - t.equal(pieces, parsedTorrent.pieces.length) - } - - t.end() - }) -}) From 1d792111929e48ebc14a8c1cf5f5a5e9b52a0b9e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 14:46:27 +0200 Subject: [PATCH 035/109] Include web torrent version in http user agent --- index.js | 2 +- test/basic-node.js | 2 +- test/blocklist.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index ad963205..3a404b2e 100644 --- a/index.js +++ b/index.js @@ -75,7 +75,7 @@ function WebTorrent (opts) { if (typeof loadIPSet === 'function') { loadIPSet(opts.blocklist, { - headers: { 'user-agent': 'WebTorrent (http://webtorrent.io)' } + headers: { 'user-agent': 'WebTorrent/' + VERSION + ' (http://webtorrent.io)' } }, function (err, ipSet) { if (err) return self.error('Failed to load blocklist: ' + err.message) self.blocked = ipSet diff --git a/test/basic-node.js b/test/basic-node.js index cfdc70f2..494dace3 100644 --- a/test/basic-node.js +++ b/test/basic-node.js @@ -16,7 +16,7 @@ test('client.add: http url to a torrent file, string', function (t) { t.plan(3) var server = http.createServer(function (req, res) { - t.equal(req.headers['user-agent'], 'WebTorrent (http://webtorrent.io)') + t.ok(req.headers['user-agent'].indexOf('WebTorrent') !== -1) res.end(leaves) }) diff --git a/test/blocklist.js b/test/blocklist.js index dd35fa02..6c646182 100644 --- a/test/blocklist.js +++ b/test/blocklist.js @@ -137,7 +137,7 @@ test('blocklist (http url)', function (t) { t.plan(49) var server = http.createServer(function (req, res) { // Check that WebTorrent declares a user agent - t.equal(req.headers['user-agent'], 'WebTorrent (http://webtorrent.io)') + t.ok(req.headers['user-agent'].indexOf('WebTorrent') !== -1) fs.createReadStream(blocklistPath).pipe(res) }) @@ -166,7 +166,7 @@ test('blocklist (http url with gzip encoding)', function (t) { t.plan(49) var server = http.createServer(function (req, res) { // Check that WebTorrent declares a user agent - t.equal(req.headers['user-agent'], 'WebTorrent (http://webtorrent.io)') + t.ok(req.headers['user-agent'].indexOf('WebTorrent') !== -1) res.setHeader('content-encoding', 'gzip') fs.createReadStream(blocklistPath) @@ -198,7 +198,7 @@ test('blocklist (http url with deflate encoding)', function (t) { t.plan(49) var server = http.createServer(function (req, res) { // Check that WebTorrent declares a user agent - t.equal(req.headers['user-agent'], 'WebTorrent (http://webtorrent.io)') + t.ok(req.headers['user-agent'].indexOf('WebTorrent') !== -1) res.setHeader('content-encoding', 'deflate') fs.createReadStream(blocklistPath) From 58cecf2126813a60a7a81d39814b7572b0093a80 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:17:01 +0200 Subject: [PATCH 036/109] test: improve server test --- test/server.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/server.js b/test/server.js index 3a3cd364..eed4157c 100644 --- a/test/server.js +++ b/test/server.js @@ -7,15 +7,19 @@ var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') test('start http server programmatically', function (t) { + t.plan(4) + var client = new WebTorrent({ tracker: false, dht: false }) client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) var torrent = client.add(leavesTorrent, { dht: false, tracker: false }, function (torrent) { - // create HTTP server for this torrent + t.pass('got "torrent" event') + var server = torrent.createServer() server.listen(0, function () { + t.pass('server is listening') var port = server.address().port get.concat('http://localhost:' + port + '/0', function (err, data) { if (err) throw err @@ -24,11 +28,13 @@ test('start http server programmatically', function (t) { server.close() client.destroy() - t.end() }) }) }) torrent.on('ready', function () { - torrent.load(fs.createReadStream(leavesPath)) + torrent.load(fs.createReadStream(leavesPath), function (err) { + if (err) throw err + t.pass('loaded seed content into torrent') + }) }) }) From 92969ae3e0eb935c9a8d3c41313b072aef4fe41e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:17:22 +0200 Subject: [PATCH 037/109] test: torrent.parsedTorrent is gone --- test/metadata.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/metadata.js b/test/metadata.js index cf386aad..fe2ee0c2 100644 --- a/test/metadata.js +++ b/test/metadata.js @@ -28,7 +28,7 @@ test('ut_metadata transfer', function (t) { client1.add(leaves) client1.on('torrent', function (torrent1) { - t.deepEqual(torrent1.parsedTorrent.info, leavesTorrent.info) + t.deepEqual(torrent1.info, leavesTorrent.info) // client2 starts with infohash client2.add(leavesTorrent.infoHash) @@ -38,7 +38,7 @@ test('ut_metadata transfer', function (t) { torrent2.addPeer('127.0.0.1:' + client1.torrentPort) client2.on('torrent', function () { - t.deepEqual(torrent1.parsedTorrent.info, torrent2.parsedTorrent.info) + t.deepEqual(torrent1.info, torrent2.info) client1.destroy(function () { t.pass('client1 destroyed') From 09f49a60550cc116c3a375edbbf6033764460d78 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:17:32 +0200 Subject: [PATCH 038/109] test: don't assume event ordering --- test/download-dht-torrent.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/download-dht-torrent.js b/test/download-dht-torrent.js index cda235ae..50e20131 100644 --- a/test/download-dht-torrent.js +++ b/test/download-dht-torrent.js @@ -77,13 +77,22 @@ test('Download using DHT (via .torrent file)', function (t) { file.getBuffer(function (err, buf) { if (err) throw err t.deepEqual(buf, leavesFile, 'downloaded correct content') + gotBuffer = true + maybeDone() }) }) torrent.once('done', function () { t.pass('client2 downloaded torrent from client1') - cb(null, client2) + torrentDone = true + maybeDone() }) + + var torrentDone = false + var gotBuffer = false + function maybeDone () { + if (torrentDone && gotBuffer) cb(null, client2) + } }) }] }, function (err, r) { From 707625133113bb4b909b79696a1e467685a322fb Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:18:13 +0200 Subject: [PATCH 039/109] torrent: make torrent.load(streams, [cb]) callback optional --- lib/torrent.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/torrent.js b/lib/torrent.js index 8d5b8f3a..1adbceb2 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1153,6 +1153,7 @@ Torrent.prototype._request = function (wire, index, hotswap) { Torrent.prototype.load = function (streams, cb) { var self = this + if (!cb) cb = noop loadChunkStore(streams, this.storage, Piece.BLOCK_LENGTH, function (err) { if (err) return cb(err) self.pieces.forEach(function (piece, index) { From 4ca7215beb39cdf5f8752f6f60806d1070378a08 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:21:09 +0200 Subject: [PATCH 040/109] cmd: torrent.parsedTorrent is gone --- bin/cmd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index 2ca529dd..19fbab13 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -566,9 +566,9 @@ function drawTorrent (torrent) { torrent.swarm.wires.every(function (wire) { var progress = '?' - if (torrent.parsedTorrent) { + if (torrent.length) { var bits = 0 - var piececount = Math.ceil(torrent.parsedTorrent.length / torrent.parsedTorrent.pieceLength) + var piececount = Math.ceil(torrent.length / torrent.pieceLength) for (var i = 0; i < piececount; i++) { if (wire.peerPieces.get(i)) { bits++ From 58089131e0498cf8c1f916dce9f38c3cd868fe3b Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:21:21 +0200 Subject: [PATCH 041/109] remove stray console logs --- lib/file-stream.js | 4 +--- lib/file.js | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/file-stream.js b/lib/file-stream.js index bd5f384f..aff81f19 100644 --- a/lib/file-stream.js +++ b/lib/file-stream.js @@ -55,9 +55,8 @@ FileStream.prototype._notify = function () { var p = self._piece self._torrent.storage.get(p, function (err, buffer) { - console.log('GOT', p) self._notifying = false - if (self.destroyed) { console.log('destroyed'); return } + if (self.destroyed) return if (err) return self.destroy(err) debug('read %s (length %s) (err %s)', p, buffer.length, err && err.message) @@ -70,7 +69,6 @@ FileStream.prototype._notify = function () { buffer = buffer.slice(0, self._missing) } self._missing -= buffer.length - console.log('missing', self._missing) debug('pushing buffer of length %s', buffer.length) self._reading = false diff --git a/lib/file.js b/lib/file.js index d85784c1..4a0802d5 100644 --- a/lib/file.js +++ b/lib/file.js @@ -80,12 +80,10 @@ File.prototype.getBuffer = function (cb) { var offset = 0 this.createReadStream() .on('data', function (chunk) { - console.log('data') chunk.copy(buf, offset) offset += chunk.length }) .on('end', function () { - console.log('END') cb(null, buf) }) .on('error', cb) From 46ae1d986f4a4348f8c24cbd3318dd26eea4278a Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:21:41 +0200 Subject: [PATCH 042/109] pass total torrent length to storage store --- lib/torrent.js | 3 ++- package.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index 1adbceb2..d269762a 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -318,7 +318,8 @@ Torrent.prototype._onMetadata = function (metadata) { length: file.length, offset: file.offset } - }) + }), + length: self.length }) ) diff --git a/package.json b/package.json index c0569817..345616c1 100644 --- a/package.json +++ b/package.json @@ -32,13 +32,13 @@ "dezalgo": "^1.0.1", "end-of-stream": "^1.0.0", "executable": "^1.1.0", - "fs-chunk-store": "^1.3.1", + "fs-chunk-store": "^1.3.4", "hat": "0.0.3", "immediate-chunk-store": "^1.0.7", "inherits": "^2.0.1", "inquirer": "^0.8.0", "load-ip-set": "^1.0.3", - "memory-chunk-store": "^1.1.2", + "memory-chunk-store": "^1.2.0", "mime": "^1.2.11", "minimist": "^1.1.0", "mkdirp": "^0.5.0", From 93f8f2675309ddd1f4497fc7533d08b19729ac6d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:22:45 +0200 Subject: [PATCH 043/109] torrent: remove dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not really sure what this code was doing — maybe trying to allow a Torrent object to be passed in to another client? Since torrent.parsedTorrent is gone and the data just lives directly on the torrent object, removing this code should work just fine. --- lib/torrent.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index d269762a..3d3ab895 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -166,16 +166,11 @@ Torrent.prototype.uploadSpeed = function () { Torrent.prototype._onTorrentId = function (torrentId) { var self = this if (self.destroyed) return - var parsedTorrent = torrentId && torrentId.parsedTorrent - if (parsedTorrent) { + parseTorrent.remote(torrentId, function (err, parsedTorrent) { + if (self.destroyed) return + if (err) return self._onError(err) self._onParsedTorrent(parsedTorrent) - } else { - parseTorrent.remote(torrentId, function (err, parsedTorrent) { - if (self.destroyed) return - if (err) return self._onError(err) - self._onParsedTorrent(parsedTorrent) - }) - } + }) } Torrent.prototype._onParsedTorrent = function (parsedTorrent) { From d154034734df4a24ef442408eccf7078e01ddb82 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:22:59 +0200 Subject: [PATCH 044/109] trigger notify after torrent.load is called --- lib/torrent.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/torrent.js b/lib/torrent.js index 3d3ab895..2eafe730 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1157,6 +1157,8 @@ Torrent.prototype.load = function (streams, cb) { self.bitfield.set(index, true) }) cb(null) + self._gcSelections() + process.nextTick(function () { self._update() }) }) } From c79028824f8290d0e46c0ee510a1661631feff89 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:27:35 +0200 Subject: [PATCH 045/109] torrent: start torrent.done as `false` --- lib/torrent.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/torrent.js b/lib/torrent.js index 2eafe730..4a59bab4 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -77,6 +77,7 @@ function Torrent (torrentId, opts) { self.storage = null self.numBlockedPeers = 0 self.files = null + self.done = false self._amInterested = false self._selections = [] From 1fef18b30613b5fd8a0618fcc1b41dfdfa43aa68 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:35:02 +0200 Subject: [PATCH 046/109] BREAKING: rename `torrent.storage` to `torrent.store` --- README.md | 4 ++-- index.js | 2 +- lib/file-stream.js | 2 +- lib/torrent.js | 28 ++++++++++++++-------------- test/download-dht-magnet.js | 6 +++--- test/download-dht-torrent.js | 7 ++++--- 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 94ab6af4..c9ad1248 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,7 @@ If `opts` is specified, then the default options (shown below) will be overridde { announce: [], // List of additional trackers to use (added to list in .torrent or magnet uri) path: String, // Folder where files will be downloaded (default=`/tmp/webtorrent/`) - storage: Function, // Custom storage engine (must follow `abstract-chunk-store` API) + store: Function, // Custom chunk store (must follow `abstract-chunk-store` API) verify: Boolean // Verify previously stored data before starting (default=false) } ``` @@ -289,7 +289,7 @@ If `onseed` is specified, it will be called when the client has begun seeding th #### `client.on('torrent', function (torrent) {})` -Emitted when a torrent is ready to be used (i.e. metadata is available and storage is +Emitted when a torrent is ready to be used (i.e. metadata is available and store is ready). See the torrent section for more info on what methods a `torrent` has. #### `client.remove(torrentId, [function callback (err) {}])` diff --git a/index.js b/index.js index 3a404b2e..1f24c4b6 100644 --- a/index.js +++ b/index.js @@ -193,7 +193,7 @@ WebTorrent.prototype.seed = function (input, opts, onseed) { debug('seed') if (!opts) opts = {} - // When seeding from filesystem path, storage should use existing location + // When seeding from filesystem, initialize store from that path (avoids a copy) if (typeof input === 'string') opts.path = path.dirname(input) if (!opts.createdBy) opts.createdBy = 'WebTorrent/' + VERSION diff --git a/lib/file-stream.js b/lib/file-stream.js index aff81f19..b69c5516 100644 --- a/lib/file-stream.js +++ b/lib/file-stream.js @@ -54,7 +54,7 @@ FileStream.prototype._notify = function () { self._notifying = true var p = self._piece - self._torrent.storage.get(p, function (err, buffer) { + self._torrent.store.get(p, function (err, buffer) { self._notifying = false if (self.destroyed) return if (err) return self.destroy(err) diff --git a/lib/torrent.js b/lib/torrent.js index 4a59bab4..c1d594ca 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -60,7 +60,7 @@ function Torrent (torrentId, opts) { self.urlList = opts.urlList self._path = opts.path - self._storage = opts.storage || FSChunkStore + self._store = opts.store || FSChunkStore self.strategy = opts.strategy || 'sequential' @@ -74,7 +74,7 @@ function Torrent (torrentId, opts) { self.ready = false self.destroyed = false self.metadata = null - self.storage = null + self.store = null self.numBlockedPeers = 0 self.files = null self.done = false @@ -306,8 +306,8 @@ Torrent.prototype._onMetadata = function (metadata) { self.rarityMap = new RarityMap(self.swarm, self.pieces.length) - self.storage = new ImmediateChunkStore( - new self._storage(self.pieceLength, { + self.store = new ImmediateChunkStore( + new self._store(self.pieceLength, { files: self.files.map(function (file) { return { path: path.join(self._path, file.path), @@ -376,7 +376,7 @@ Torrent.prototype._onMetadata = function (metadata) { // }), self._onStorage.bind(self)) // }) process.nextTick(function () { - self._onStorage() + self._onStore() }) process.nextTick(function () { @@ -385,12 +385,12 @@ Torrent.prototype._onMetadata = function (metadata) { } /** - * Called when the metadata, swarm, and underlying storage are all fully initialized. + * Called when the metadata, swarm, and underlying chunk store is initialized. */ -Torrent.prototype._onStorage = function () { +Torrent.prototype._onStore = function () { var self = this if (self.destroyed) return - debug('on storage') + debug('on store') // start off selecting the entire torrent with low priority self.select(0, self.pieces.length - 1, false) @@ -428,7 +428,7 @@ Torrent.prototype.destroy = function (cb) { if (self.swarm) tasks.push(function (cb) { self.swarm.destroy(cb) }) if (self.discovery) tasks.push(function (cb) { self.discovery.stop(cb) }) - if (self.storage) tasks.push(function (cb) { self.storage.close(cb) }) + if (self.store) tasks.push(function (cb) { self.store.close(cb) }) parallel(tasks, cb) } @@ -680,7 +680,7 @@ Torrent.prototype._onWireWithMetadata = function (wire) { return wire.destroy() } if (self.pieces[index]) return - self.storage.get(index, { offset: offset, length: length }, cb) + self.store.get(index, { offset: offset, length: length }, cb) }) wire.bitfield(self.bitfield) // always send bitfield (required) @@ -707,7 +707,7 @@ Torrent.prototype._updateSelections = function () { } /** - * Garbage collect selections with respect to the storage's current state. + * Garbage collect selections with respect to the store's current state. */ Torrent.prototype._gcSelections = function () { var self = this @@ -1049,7 +1049,7 @@ Torrent.prototype._request = function (wire, index, hotswap) { var maxOutstandingRequests = getPipelineLength(wire, PIPELINE_MAX_DURATION) if (numRequests >= maxOutstandingRequests) return false - // var endGame = (wire.requests.length === 0 && self.storage.numMissing < 30) + // var endGame = (wire.requests.length === 0 && self.store.numMissing < 30) var piece = self.pieces[index] var reservation = piece.reserve() @@ -1107,7 +1107,7 @@ Torrent.prototype._request = function (wire, index, hotswap) { self._reservations[index] = null self.bitfield.set(index, true) - self.storage.put(index, buf) + self.store.put(index, buf) self.swarm.wires.forEach(function (wire) { wire.have(index) @@ -1151,7 +1151,7 @@ Torrent.prototype._request = function (wire, index, hotswap) { Torrent.prototype.load = function (streams, cb) { var self = this if (!cb) cb = noop - loadChunkStore(streams, this.storage, Piece.BLOCK_LENGTH, function (err) { + loadChunkStore(streams, this.store, Piece.BLOCK_LENGTH, function (err) { if (err) return cb(err) self.pieces.forEach(function (piece, index) { self.pieces[index] = null diff --git a/test/download-dht-magnet.js b/test/download-dht-magnet.js index 93e95345..b1c6a7ad 100644 --- a/test/download-dht-magnet.js +++ b/test/download-dht-magnet.js @@ -38,9 +38,9 @@ test('Download using DHT (via magnet uri)', function (t) { client1.on('warning', function (err) { t.fail(err) }) var announced = false - var wroteStorage = false + var loaded = false function maybeDone () { - if (announced && wroteStorage) cb(null, client1) + if (announced && loaded) cb(null, client1) } client1.add(leavesParsed, function (torrent) { @@ -57,7 +57,7 @@ test('Download using DHT (via magnet uri)', function (t) { torrent.load(fs.createReadStream(leavesPath), function (err) { t.error(err) - wroteStorage = true + loaded = true maybeDone() }) }) diff --git a/test/download-dht-torrent.js b/test/download-dht-torrent.js index 50e20131..bc51a71c 100644 --- a/test/download-dht-torrent.js +++ b/test/download-dht-torrent.js @@ -38,9 +38,10 @@ test('Download using DHT (via .torrent file)', function (t) { client1.add(leavesParsed) - var announced, wroteStorage + var announced = false + var loaded = false function maybeDone (err) { - if ((announced && wroteStorage) || err) cb(err, client1) + if ((announced && loaded) || err) cb(err, client1) } client1.on('torrent', function (torrent) { @@ -56,7 +57,7 @@ test('Download using DHT (via .torrent file)', function (t) { }) torrent.load(fs.createReadStream(leavesPath), function (err) { - wroteStorage = true + loaded = true maybeDone(err) }) }) From 32f65b8bb4dfc057b56cc9458852a7e66ba092ea Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:39:20 +0200 Subject: [PATCH 047/109] update docs: remove opts.verify --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c9ad1248..10053f5a 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ If `opts` is specified, then the default options (shown below) will be overridde peerId: String|Buffer, // Wire protocol peer ID (default=randomly generated) rtcConfig: Object, // RTCPeerConnection configuration object (default=STUN only) tracker: Boolean, // Whether or not to enable trackers (default=true) - wrtc: {} // Custom webrtc implementation (in node, specify the [wrtc](https://www.npmjs.com/package/wrtc) package) + wrtc: Object // Custom webrtc implementation (in node, specify the [wrtc](https://www.npmjs.com/package/wrtc) package) } ``` @@ -252,10 +252,9 @@ If `opts` is specified, then the default options (shown below) will be overridde ```js { - announce: [], // List of additional trackers to use (added to list in .torrent or magnet uri) - path: String, // Folder where files will be downloaded (default=`/tmp/webtorrent/`) - store: Function, // Custom chunk store (must follow `abstract-chunk-store` API) - verify: Boolean // Verify previously stored data before starting (default=false) + announce: [], // Torrent trackers to use (added to list in .torrent or magnet uri) + path: String, // Folder to download files to (default=`/tmp/webtorrent/`) + store: Function // Custom chunk store (must follow [abstract-chunk-store](https://www.npmjs.com/package/abstract-chunk-store) API) } ``` From 0138ed97bce5a0efa0d9a25f50bb49d6839a453c Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:57:41 +0200 Subject: [PATCH 048/109] remove unecessary nextTicks --- lib/torrent.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index c1d594ca..bdeebbad 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -373,14 +373,12 @@ Torrent.prototype._onMetadata = function (metadata) { // cb() // }, true) // forces override to allow reading from non-verified pieces // } - // }), self._onStorage.bind(self)) + // }), self._onStore.bind(self)) // }) - process.nextTick(function () { - self._onStore() - }) process.nextTick(function () { self.emit('metadata') + self._onStore() }) } @@ -398,10 +396,8 @@ Torrent.prototype._onStore = function () { self._rechokeIntervalId = setInterval(self._rechoke.bind(self), RECHOKE_INTERVAL) if (self._rechokeIntervalId.unref) self._rechokeIntervalId.unref() - process.nextTick(function () { - self.ready = true - self.emit('ready') - }) + self.ready = true + self.emit('ready') } /** From 8a7f235153952bb652ea97a7aa54c39cbd968162 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:58:08 +0200 Subject: [PATCH 049/109] file: emit 'done' on zero-length file --- lib/file.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/file.js b/lib/file.js index 4a0802d5..44e8c6bc 100644 --- a/lib/file.js +++ b/lib/file.js @@ -24,13 +24,18 @@ function File (torrent, file) { this.length = file.length this.offset = file.offset - this.done = (this.length === 0) + this.done = false var start = file.offset var end = start + file.length - 1 this._startPiece = start / this._torrent.pieceLength | 0 this._endPiece = end / this._torrent.pieceLength | 0 + + if (this.length === 0) { + this.done = true + this.emit('done') + } } /** From 72320e57667e5b2bf5fc95a537ac102299152f9e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 17:58:22 +0200 Subject: [PATCH 050/109] file: make file.createReadStream work on zero-length file --- lib/file.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/file.js b/lib/file.js index 44e8c6bc..51490471 100644 --- a/lib/file.js +++ b/lib/file.js @@ -7,6 +7,7 @@ var FileStream = require('./file-stream') var inherits = require('inherits') var mime = require('./mime.json') var path = require('path') +var stream = require('stream') inherits(File, EventEmitter) @@ -67,14 +68,22 @@ File.prototype.deselect = function () { */ File.prototype.createReadStream = function (opts) { var self = this - var stream = new FileStream(self, opts) - self._torrent.select(stream._startPiece, stream._endPiece, true, function () { - stream._notify() + if (this.length === 0) { + var empty = new stream.PassThrough() + process.nextTick(function () { + empty.end() + }) + return empty + } + + var fileStream = new FileStream(self, opts) + self._torrent.select(fileStream._startPiece, fileStream._endPiece, true, function () { + fileStream._notify() }) - eos(stream, function () { - self._torrent.deselect(stream._startPiece, stream._endPiece, true) + eos(fileStream, function () { + self._torrent.deselect(fileStream._startPiece, fileStream._endPiece, true) }) - return stream + return fileStream } /** From f50e82fc0747df6d9b8785a7becd1ee101f78693 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 23:05:46 +0200 Subject: [PATCH 051/109] remove dezalgo dep --- lib/append-to.js | 13 +++++++++---- package.json | 1 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/append-to.js b/lib/append-to.js index 8d09b0b5..9ed09e98 100644 --- a/lib/append-to.js +++ b/lib/append-to.js @@ -1,5 +1,4 @@ var debug = require('debug')('webtorrent:append-to') -var dezalgo = require('dezalgo') var MediaSourceStream = require('./media-stream') var path = require('path') var videostream = require('videostream') @@ -17,7 +16,7 @@ var IFRAME_EXTS = [ '.css', '.html', '.js', '.md', '.pdf', '.txt' ] var MediaSource = typeof window !== 'undefined' && window.MediaSource module.exports = function appendTo (file, rootElem, cb) { - cb = dezalgo(cb || noop) + if (!cb) cb = noop var elem var extname = path.extname(file.name).toLowerCase() var currentTime = 0 @@ -33,11 +32,11 @@ module.exports = function appendTo (file, rootElem, cb) { else if (AUDIO_EXTS.indexOf(extname) >= 0) appendToAudio() else if (IMAGE_EXTS.indexOf(extname) >= 0) appendToImage() else if (IFRAME_EXTS.indexOf(extname) >= 0) appendToIframe() - else cb(new Error('Unsupported file type "' + extname + '": Cannot append to DOM')) + else nextTick(cb, new Error('Unsupported file type "' + extname + '": Cannot append to DOM')) function appendToMediaSource () { if (!MediaSource) { - return cb(new Error( + return nextTick(cb, new Error( 'Video/audio streaming is not supported in your browser. You can still share ' + 'or download ' + file.name + ' (once it\'s fully downloaded). Use Chrome for ' + 'MediaSource support.' @@ -161,3 +160,9 @@ module.exports = function appendTo (file, rootElem, cb) { } function noop () {} + +function nextTick (cb, err, val) { + process.nextTick(function () { + if (cb) cb(err, val) + }) +} diff --git a/package.json b/package.json index 345616c1..7d6fd8fe 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "clivas": "^0.2.0", "create-torrent": "^3.4.0", "debug": "^2.1.0", - "dezalgo": "^1.0.1", "end-of-stream": "^1.0.0", "executable": "^1.1.0", "fs-chunk-store": "^1.3.4", From c45301bbdb2cd75427681a035abea7c9115ff581 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 23:09:00 +0200 Subject: [PATCH 052/109] remove unused deps: mkdirp, once, random-access-file, rimraf --- package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.json b/package.json index 7d6fd8fe..db4f5d1b 100644 --- a/package.json +++ b/package.json @@ -40,20 +40,16 @@ "memory-chunk-store": "^1.2.0", "mime": "^1.2.11", "minimist": "^1.1.0", - "mkdirp": "^0.5.0", "moment": "^2.8.3", "multistream": "^2.0.2", "network-address": "^1.0.0", - "once": "^1.3.1", "parse-torrent": "^5.1.0", "path-exists": "^1.0.0", "pretty-bytes": "^2.0.1", "pump": "^1.0.0", - "random-access-file": "^0.3.1", "random-iterate": "^1.0.1", "range-parser": "^1.0.2", "re-emitter": "^1.0.0", - "rimraf": "^2.2.5", "run-parallel": "^1.0.0", "simple-sha1": "^2.0.0", "speedometer": "^0.1.2", From 45d0a52aa140b1134f600de5ba2039fc10103dc2 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 23:27:50 +0200 Subject: [PATCH 053/109] use `chunk-store-stream` (published from 'lib/load-chunk-store') --- lib/load-chunk-store.js | 61 ----------------------------------------- lib/torrent.js | 11 ++++++-- package.json | 2 +- 3 files changed, 10 insertions(+), 64 deletions(-) delete mode 100644 lib/load-chunk-store.js diff --git a/lib/load-chunk-store.js b/lib/load-chunk-store.js deleted file mode 100644 index f9359350..00000000 --- a/lib/load-chunk-store.js +++ /dev/null @@ -1,61 +0,0 @@ -// TODO: publish this as a standalone module - -module.exports = loadChunkStore - -var BlockStream = require('block-stream2') -var MultiStream = require('multistream') - -function loadChunkStore (streams, store, chunkLength, cb) { - if (!Array.isArray(streams)) streams = [ streams ] - if (!cb) cb = noop - - var index = 0 - var outstandingPuts = 0 - var finished = false - - var multistream = new MultiStream(streams) - var blockstream = new BlockStream(chunkLength, { zeroPadding: false }) - - multistream - .on('error', onError) - .pipe(blockstream) - .on('data', onData) - .on('finish', onFinish) - .on('error', onError) - - function onData (chunk) { - outstandingPuts += 1 - store.put(index, chunk, function (err) { - if (err) return onError(err) - outstandingPuts -= 1 - maybeDone() - }) - index += 1 - } - - function onFinish () { - finished = true - maybeDone() - } - - function onError (err) { - cleanup() - cb(err) - } - - function maybeDone () { - if (finished && outstandingPuts === 0) { - cleanup() - cb(null) - } - } - - function cleanup () { - multistream.removeListener('error', onError) - blockstream.removeListener('data', onData) - blockstream.removeListener('finish', onFinish) - blockstream.removeListener('error', onError) - } -} - -function noop () {} diff --git a/lib/torrent.js b/lib/torrent.js index bdeebbad..8207d6a8 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -2,6 +2,7 @@ module.exports = Torrent var addrToIPPort = require('addr-to-ip-port') // browser exclude var BitField = require('bitfield') +var ChunkStoreWriteStream = require('chunk-store-stream/write') var createTorrent = require('create-torrent') var debug = require('debug')('webtorrent:torrent') var Discovery = require('torrent-discovery') @@ -10,12 +11,14 @@ var extend = require('xtend/mutable') var FSChunkStore = require('fs-chunk-store') var ImmediateChunkStore = require('immediate-chunk-store') var inherits = require('inherits') +var MultiStream = require('multistream') var os = require('os') var parallel = require('run-parallel') var parseTorrent = require('parse-torrent') var path = require('path') var pathExists = require('path-exists') var Piece = require('torrent-piece') +var pump = require('pump') var randomIterate = require('random-iterate') var reemit = require('re-emitter') var sha1 = require('simple-sha1') @@ -25,7 +28,6 @@ var ut_metadata = require('ut_metadata') var ut_pex = require('ut_pex') // browser exclude var File = require('./file') -var loadChunkStore = require('./load-chunk-store') var RarityMap = require('./rarity-map') var Server = require('./server') // browser exclude @@ -1146,8 +1148,13 @@ Torrent.prototype._request = function (wire, index, hotswap) { Torrent.prototype.load = function (streams, cb) { var self = this + if (!Array.isArray(streams)) streams = [ streams ] if (!cb) cb = noop - loadChunkStore(streams, this.store, Piece.BLOCK_LENGTH, function (err) { + + var readable = new MultiStream(streams) + var writable = new ChunkStoreWriteStream(self.store, self.pieceLength) + + pump(readable, writable, function (err) { if (err) return cb(err) self.pieces.forEach(function (piece, index) { self.pieces[index] = null diff --git a/package.json b/package.json index db4f5d1b..94a8d23f 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "bitfield": "^1.0.2", "bittorrent-dht": "^3.0.0", "bittorrent-swarm": "^5.0.0", - "block-stream2": "^1.0.0", + "chunk-store-stream": "^2.0.0", "clivas": "^0.2.0", "create-torrent": "^3.4.0", "debug": "^2.1.0", From 689b9e46e521a7aebe029587abd05f7ef0f53795 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 22 Aug 2015 23:34:26 +0200 Subject: [PATCH 054/109] inquirer@0.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 94a8d23f..58270b31 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "hat": "0.0.3", "immediate-chunk-store": "^1.0.7", "inherits": "^2.0.1", - "inquirer": "^0.8.0", + "inquirer": "^0.9.0", "load-ip-set": "^1.0.3", "memory-chunk-store": "^1.2.0", "mime": "^1.2.11", From 45891e2883a70d031af84bdc111053791b20bd8b Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 03:35:48 +0200 Subject: [PATCH 055/109] append-to: Support .jpeg (alternative to .jpg) --- lib/append-to.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/append-to.js b/lib/append-to.js index 9ed09e98..a8294dd1 100644 --- a/lib/append-to.js +++ b/lib/append-to.js @@ -10,7 +10,7 @@ var MEDIASOURCE_AUDIO_EXTS = [ '.m4a', '.mp3' ] var MEDIASOURCE_EXTS = MEDIASOURCE_VIDEO_EXTS.concat(MEDIASOURCE_AUDIO_EXTS) var AUDIO_EXTS = [ '.wav', '.aac', '.ogg', '.oga' ] -var IMAGE_EXTS = [ '.jpg', '.png', '.gif', '.bmp' ] +var IMAGE_EXTS = [ '.jpg', '.jpeg', '.png', '.gif', '.bmp' ] var IFRAME_EXTS = [ '.css', '.html', '.js', '.md', '.pdf', '.txt' ] var MediaSource = typeof window !== 'undefined' && window.MediaSource From d594cd91f5b49c6e2bc56001544a3182cd5a99c5 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 03:45:53 +0200 Subject: [PATCH 056/109] check for torrent.done, file.done on torrent.load() --- lib/torrent.js | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index 8207d6a8..0319b128 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1111,26 +1111,7 @@ Torrent.prototype._request = function (wire, index, hotswap) { wire.have(index) }) - // are any new files done? - self.files.forEach(function (file) { - if (file.done) return - for (var i = file._startPiece; i <= file._endPiece; ++i) { - if (!self.bitfield.get(i)) return - } - file.done = true - file.emit('done') - debug('file done: ' + file.name) - }) - - // is the torrent done? - if (self.files.every(function (file) { return file.done })) { - self.done = true - self.emit('done') - debug('torrent done: ' + self.infoHash) - if (self.discovery.tracker) self.discovery.tracker.complete() - } - - self._gcSelections() + self._onPiece() } else { self.pieces[index] = new Piece(piece.length) self.emit('warning', new Error('Piece ' + index + ' failed verification')) @@ -1146,6 +1127,31 @@ Torrent.prototype._request = function (wire, index, hotswap) { return true } +Torrent.prototype._onPiece = function () { + var self = this + + // are any new files done? + self.files.forEach(function (file) { + if (file.done) return + for (var i = file._startPiece; i <= file._endPiece; ++i) { + if (!self.bitfield.get(i)) return + } + file.done = true + file.emit('done') + debug('file done: ' + file.name) + }) + + // is the torrent done? + if (self.files.every(function (file) { return file.done })) { + self.done = true + self.emit('done') + debug('torrent done: ' + self.infoHash) + if (self.discovery.tracker) self.discovery.tracker.complete() + } + + self._gcSelections() +} + Torrent.prototype.load = function (streams, cb) { var self = this if (!Array.isArray(streams)) streams = [ streams ] @@ -1160,9 +1166,8 @@ Torrent.prototype.load = function (streams, cb) { self.pieces[index] = null self.bitfield.set(index, true) }) + self._onPiece() cb(null) - self._gcSelections() - process.nextTick(function () { self._update() }) }) } From 86ffa120903e7bc68a58dcd51d8c5c57b2f1d098 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 03:51:51 +0200 Subject: [PATCH 057/109] 0.58.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 58270b31..75e445da 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.57.0", + "version": "0.58.0", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From 5026632144dedc88e7430ecc447d3f2054b5453b Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 03:52:05 +0200 Subject: [PATCH 058/109] build --- webtorrent.min.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 09735d86..5a18b469 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,12 +1,11 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=this._parserSize){var i=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[i.slice(this._parserSize)]:[];this._parser(i.slice(0,this._parserSize))}n(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,n){var i=n?n.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+i-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,n){for(var i=0;i>3;if(e%8!==0)t++;return t}n.prototype.get=function(e){var t=e>>3;return t>e%8)};n.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};n.prototype._grow=function(e){if(this.buffer.length=31}r.formatters.j=function(e){return JSON.stringify(e)};function i(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){a=i}});e.splice(a,0,n);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":9}],9:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function a(){return r.colors[n++%r.colors.length]}function s(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var s=t-(i||t);e.diff=s;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;f++;var i=r.formatters[n];if("function"===typeof i){var a=o[f];t=i.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=n.log||r.log||console.log.bind(console);u.apply(e,o)}n.enabled=true;var s=r.enabled(e)?n:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,i,"minute")||c(e,n,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return n(e,t)}else return s};n.rack=function(e,t,r){var i=function(i){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=n(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=i;return o};var a=i.hats={};i.get=function(e){return i.hats[e]};i.set=function(e,t){i.hats[e]=t;return i};i.bits=e||128;i.base=t||16;return i}},{}],12:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function n(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],13:[function(e,t,r){var n=1;var i=65535;var a=4;var s=function(){n=n+1&i};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=n-1&i;return function(e){var f=n-o&i;if(f>t)f=t;o=n;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=i(t.addr);var n={host:r[0],port:r[1]};if(e._hostname)n.localAddress=e._hostname;var s=t.conn=u.connect(n);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var n=setTimeout(function i(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(n.unref)n.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=i(e);var n=r[0];var a=r[1];return a>0&&a<65535&&!(n==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":16,"./lib/tcp-pool":17,_process:172,"addr-to-ip-port":163,buffer:164,debug:20,dezalgo:23,events:168,inherits:27,net:163,speedometer:28}],16:[function(e,t,r){var n=e("debug")("bittorrent-swarm:peer");var i=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var n=new f(e);n.swarm=r;n.conn=new i(e,t);n.onConnect();return n};function f(e){var t=this;t.id=e;n("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;n("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var i=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(i!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}n("Peer %s got handshake %s",r.id,i);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;n("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var i=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(i)i.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":18,"bittorrent-protocol":2,debug:20}],17:[function(e,t,r){(function(r){t.exports=f;var n=e("debug")("bittorrent-swarm:tcp-pool");var i=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};n("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var n=o[e._port];if(!n)return t();n.removeSwarm(e);var i=0;for(var a in n.swarms){var s=n.swarms[a];if(s)i+=1}if(i===0)n.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}n("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;n("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=i(e);n("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;n("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var i in e.swarms){var a=e.swarms[i];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){ -t.pendingConns.splice(t.pendingConns.indexOf(e))}var n=s.createIncomingTCPPeer(e);n.wire.once("handshake",function(i,a){var s=i.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){n.swarm=o;o._addIncomingPeer(n);n.onHandshake(i,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+n.id+": destroying peer");n.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var n=t.swarms[r];if(n){t.removeSwarm(n);n._onError(e)}}}}).call(this,e("_process"))},{"./peer":16,_process:172,debug:20,dezalgo:23,net:163}],18:[function(e,t,r){(function(r){t.exports=f;var n=e("bitfield");var i=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,i){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new n(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){i("choke")});a.on("unchoke",function(){i("unchoke")});a.once("interested",function(){i("interested");a.unchoke()});a.on("uninterested",function(){i("uninterested")});a.on("bitfield",function(){i("bitfield")});a.on("request",function(e,t,r,n){i("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,n)})}f.prototype.httpRequest=function(e,t,r,n){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;i("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return n(e);if(r.statusCode<200||r.statusCode>=300){return n(new Error("Unexpected HTTP status code "+r.statusCode))}i("Got data of length %d",t.length);n(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:19,"bittorrent-protocol":2,buffer:164,debug:20,inherits:27,"simple-get":105}],19:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],20:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":21,dup:8}],21:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:22}],22:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],23:[function(e,t,r){var n=e("wrappy");t.exports=n(a);var i=e("asap");function a(e){var t=true;i(function(){t=false});return function r(){var r=arguments;var n=this;if(t)i(function(){e.apply(n,r)});else e.apply(n,r)}}},{asap:24,wrappy:26}],24:[function(e,t,r){"use strict";var n=e("./raw");var i=[];var a=[];var s=n.makeRequestCallFromTimer(o);function o(){if(a.length){throw a.shift()}}t.exports=f;function f(e){var t;if(i.length){t=i.pop()}else{t=new u}t.task=e;n(t)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(e){if(f.onerror){f.onerror(e)}else{a.push(e);s()}}finally{this.task=null;i[i.length]=this}}},{"./raw":25}],25:[function(e,t,r){(function(e){"use strict";t.exports=r;function r(e){if(!n.length){a();i=true}n[n.length]=e}var n=[];var i=false;var a;var s=0;var o=1024;function f(){while(so){for(var t=0,r=n.length-s;t1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(n,i){if(n)return r(n);if(Array.isArray(i))i=l(i);else i=[i];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;i.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,i)})}function x(e,t){t=m(t);c.stat(e,function(r,n){if(r)return t(r);var i={length:n.size,path:e};t(null,i)})}function k(e,t,r){c.readdir(e,function(n,i){if(n&&n.code==="ENOTDIR"){t(e,r)}else if(n){r(n)}else{v(i.filter(S).filter(d.not).map(function(r){return function(n){k(o.join(e,r),t,n)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var i=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){i[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new n(i.join(""),"hex"),s)}}}function A(e,n,a){var o=n.announceList;if(!o){if(typeof n.announce==="string")o=[[n.announce]];else if(Array.isArray(n.announce)){o=n.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof n.urlList==="string")n.urlList=[n.urlList];var f={info:{name:n.name},announce:o[0][0],"announce-list":o,"creation date":Number(n.creationDate)||Date.now(),encoding:"UTF-8"};if(n.comment!==undefined)f.comment=n.comment;if(n.createdBy!==undefined)f["created by"]=n.createdBy;if(n.private!==undefined)f.info.private=Number(n.private);if(n.sslCert!==undefined)f.info["ssl-cert"]=n.sslCert;if(n.urlList!==undefined)f["url-list"]=n.urlList;var u=n.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(n.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,i.encode(f))})}function U(e,t){return e+t.length}function T(e){return typeof Blob!=="undefined"&&e instanceof Blob}function I(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,n){t.length+=e.length;this.push(e);n()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:44,"block-stream2":48,buffer:164,dezalgo:60,"filestream/read":67,flatten:68,fs:162,"is-file":69,junk:70,multistream:71,once:74,path:171,"piece-length":75,"run-parallel":100,"simple-sha1":77,stream:190}],44:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":45,"./lib/encode":47,dup:3}],45:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":46,buffer:164,dup:4}],46:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],47:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],48:[function(e,t,r){(function(r){var n=e("inherits");var i=e("readable-stream").Transform;var a=e("defined");t.exports=s;n(s,i);function s(e,t){if(!(this instanceof s))return new s(e,t);i.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,n){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var i=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(i.slice(0,this.size));this._buffered=[i.slice(this.size,i.length)]}n()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:164,defined:49,inherits:50,"readable-stream":59}],49:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!i){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)T(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)T(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=U(e,t);else i=null;if(o.isNull(i)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)T(this);if(!o.isNull(i))this.emit("data",i);return i};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(a)o=r.join("");else o=i.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,n=e.length;r1){var r=[];for(var n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:164}],59:[function(e,t,r){r=t.exports=e("./lib/_stream_readable.js");r.Stream=e("stream");r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js")},{"./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,stream:190}],60:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:61,dup:23,wrappy:63}],61:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":62,dup:24}],62:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],63:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],64:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],65:[function(e,t,r){(function(r){var n=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(n(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:164,"is-typedarray":66}],66:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var n=Object.prototype.toString;var i={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return i[n.call(e)]}},{}],67:[function(e,t,r){var n=e("stream").Readable;var i=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};n.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}i(o,n);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var n=this._offset+this._chunkSize;if(n>this._size)n=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=n;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,n))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:64,stream:190,"typedarray-to-buffer":65}],68:[function(e,t,r){t.exports=function n(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,n){return e.reduce(function(e,i){if(Array.isArray(i)&&n=r){break}r=n;i=t[a]}return i}},{}],77:[function(e,t,r){var n=e("rusha");var i=new n;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=i.digest.bind(i);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function n(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var n=0;n>>4).toString(16));r.push((i&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:78}],78:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function n(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a.charCodeAt(r);case 1:e[i+2|0]=a.charCodeAt(r+1);case 2:e[i+1|0]=a.charCodeAt(r+2);case 3:e[i|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[i+u+1|0]=a.charCodeAt(r+u+2);case 2:e[i+u+2|0]=a.charCodeAt(r+u+1);case 1:e[i+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,n,i){var a=this,s,o=i%4,f=n%4,u=n-f;if(u>0){switch(o){case 0:e[i+3|0]=a[r];case 1:e[i+2|0]=a[r+1];case 2:e[i+1|0]=a[r+2];case 3:e[i|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[i+u+1|0]=a[r+u+2];case 2:e[i+u+2|0]=a[r+u+1];case 1:e[i+u+3|0]=a[r+u]}};var l=function(e,t,r,n,a){var s=this,o,f=a%4,u=n%4,l=n-u;var c=new Uint8Array(i.readAsArrayBuffer(s.slice(r,r+n)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,n="0123456789abcdef",i=[],a=new Uint8Array(e);for(t=0;t>4&15)+n.charAt(r>>0&15)}return i.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new n._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var n=a(e);var i=new Int32Array(t.heap,0,n>>2);s(i,e);o(i,e,r);return n};var y=function(e,r,n){c(e)(t.h8,t.h32,r,n,0)};var _=function(e,r,n,i,a){var s=n;if(a){s=g(n,i)}y(e,r,n);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var n=new Int32Array(5);var i=new DataView(n.buffer);i.setInt32(0,r[0],false);i.setInt32(4,r[1],false);i.setInt32(8,r[2],false);i.setInt32(12,r[3],false);i.setInt32(16,r[4],false);return n};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var n=0,i=t.maxChunkLen,a;for(n=0;r>n+i;n+=i){_(e,n,i,r,false)}_(e,n,r-n,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}n._core=function s(e,t,r){"use asm";var n=new e.Int32Array(r);function i(e,t){e=e|0;t=t|0;var r=0,i=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=n[t+320>>2]|0;o=n[t+324>>2]|0;u=n[t+328>>2]|0;c=n[t+332>>2]|0;d=n[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(i=0;(i|0)<64;i=i+4|0){v=n[r+i>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[e+i>>2]=v}for(i=e+64|0;(i|0)<(e+80|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+80|0;(i|0)<(e+160|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+160|0;(i|0)<(e+240|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}for(i=e+240|0;(i|0)<(e+320|0);i=i+4|0){v=(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])<<1|(n[i-12>>2]^n[i-32>>2]^n[i-56>>2]^n[i-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;n[i>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}n[t+320>>2]=a;n[t+324>>2]=o;n[t+328>>2]=u;n[t+332>>2]=c;n[t+336>>2]=d}return{hash:i}};if(typeof t!=="undefined"){t.exports=n}else if(typeof window!=="undefined"){window.Rusha=n}if(typeof FileReaderSync!=="undefined"){var i=new FileReaderSync,a=new n(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(n){self.postMessage({id:e.data.id,error:n.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],79:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var n=e("thirty-two");var i=e("xtend");var a=e("uniq");function s(e){var t={};var i=e.split("magnet:?")[1];var s=i&&i.length>=0?i.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var n=r[0];var i=r[1];if(n==="dn")i=decodeURIComponent(i).replace(/\+/g," ");if(n==="tr"||n==="xs"||n==="as"||n==="ws"){i=decodeURIComponent(i)}if(n==="kt")i=decodeURIComponent(i).split("+");if(t[n]){if(Array.isArray(t[n])){t[n].push(i)}else{var a=t[n];t[n]=[a,i]}}else{t[n]=i}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var i=n.decode(o[1]);t.infoHash=new r(i,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=i(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,n){var i=Array.isArray(e[r])?e[r]:[e[r]];i.forEach(function(e,i){if((n>0||i>0)&&(r!=="kt"||i===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&i>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:164,"thirty-two":80,uniq:82,xtend:83}],80:[function(e,t,r){var n=e("./thirty-two");r.encode=n.encode;r.decode=n.decode},{"./thirty-two":81}],81:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var n=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function i(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var n=0;var a=0;var s=0;var o=0;var f=new e(i(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(n3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;n++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)n++}f[a]=t.charCodeAt(o);a++}for(n=a;n>>r;o[s]=a;s++;a=255&i<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:164}],82:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],83:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],84:[function(e,t,r){t.exports=a;var n=e("inherits");var i=e("stream");n(a,i.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);i.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=typeof e==="function"?e:e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained||!this._current)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();if(typeof this._queue!=="function"){this._queue.forEach(function(e){if(e.destroy)e.destroy()})}if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;e._current=null;if(typeof e._queue==="function"){e._queue(function(t,r){if(t)return e.destroy(t);e._gotNextStream(s(r))})}else{var t=e._queue.shift();if(typeof t==="function")t=s(t());e._gotNextStream(t)}};a.prototype._gotNextStream=function(e){var t=this;if(!e){t.push(null);t.destroy();return}t._current=e;t._forward();e.on("readable",r);e.on("end",i);e.on("error",a);e.on("close",n);function r(){t._forward()}function n(){if(!e._readableState.ended){t.destroy()}}function i(){t._current=null;e.removeListener("readable",r);e.removeListener("end",i);e.removeListener("error",a);e.removeListener("close",n);t._next()}function a(e){t.destroy(e)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new i.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:85,stream:190}],85:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],86:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var n=e("bencode");var i=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=n.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=n.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:i.join.apply(null,[i.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return n.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,n){if(e)return t(e);var i=[];n.on("data",function(e){i.push(e)});n.on("end",function(){t(null,r.concat(i),n)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:164,http:191,https:169,"object-assign":106,once:108,"unzip-response":163,url:201}],106:[function(e,t,r){"use strict";var n=Object.prototype.propertyIsEnumerable;function i(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return n.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var n;var s=i(e);for(var o=1;on._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var n=e._cb;e._cb=null;n(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(n){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];n.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:164,debug:110,"get-browser-rtc":113,hat:114,inherits:115,"is-typedarray":116,once:118,stream:190,"typedarray-to-buffer":131}],110:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":111,dup:8}],111:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:112}],112:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],113:[function(e,t,r){t.exports=function n(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],114:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],115:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],116:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],117:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],118:[function(e,t,r){arguments[4][40][0].apply(r,arguments)},{dup:40,wrappy:117}],119:[function(e,t,r){(function(r){t.exports=l;var n=e("debug")("simple-websocket");var i=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;i(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};n("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var i=e.length||e.byteLength||e.size;t._ws.send(e);n("write: %d bytes",i)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);n("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var i=r._ws;var a=function(){i.onclose=null;r.emit("close")};if(i.readyState===u.CLOSED){a()}else{try{i.onclose=a;i.close()}catch(e){a()}}i.onopen=null;i.onmessage=null;i.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after socket is destroyed"));if(i.connected){try{i.send(e)}catch(a){return i._onError(a)}if(typeof f!=="function"&&i._ws.bufferedAmount>i._maxBufferedAmount){n("start backpressure: bufferedAmount %d",i._ws.bufferedAmount);i._cb=r}else{r(null)}}else{n("write before connect");i._chunk=e;i._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var i=e.data;n("read: %d bytes",i.byteLength||i.length);if(i instanceof ArrayBuffer){i=o(new Uint8Array(i));t.push(i)}else if(r.isBuffer(i)){t.push(i)}else{try{i=JSON.parse(i)}catch(a){}t.emit("data",i)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;n('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}n("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}n("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;n("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;n("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:164,debug:120,inherits:123,"is-typedarray":124,stream:190,"typedarray-to-buffer":131,ws:163}],120:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":121,dup:8}],121:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:122}],122:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],123:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],124:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],125:[function(e,t,r){(function(r,n){t.exports=p;var i=e("debug")("torrent-discovery");var a=e("bittorrent-dht/client");var s=e("events").EventEmitter;var o=e("xtend/mutable");var f=e("inherits");var u=e("run-parallel");var l=e("re-emitter");var c=e("bittorrent-tracker/client");f(p,s);function p(e){var t=this;if(!(t instanceof p))return new p(e);s.call(t);o(t,{announce:[],dht:typeof a==="function",rtcConfig:null,peerId:null,port:0,tracker:true,wrtc:null},e);t.infoHash=null;t.infoHashHex=null;t.torrent=null;t._externalDHT=typeof t.dht==="object";t._performedDHTLookup=false;if(!t.peerId)throw new Error("peerId required");if(!r.browser&&!t.port)throw new Error("port required");if(t.dht)t._createDHT(t.dhtPort)}p.prototype.setTorrent=function(e){var t=this;if(!t.infoHash&&n.isBuffer(e)||typeof e==="string"){t.infoHash=typeof e==="string"?new n(e,"hex"):e}else if(!t.torrent&&e&&e.infoHash){t.torrent=e;t.infoHash=typeof e.infoHash==="string"?new n(e.infoHash,"hex"):e.infoHash}else{return}t.infoHashHex=t.infoHash.toString("hex");i("setTorrent %s",t.infoHashHex);if(t.tracker&&t.tracker!==true){t.tracker.torrentLength=e.length}else{t._createTracker()}if(t.dht){if(t.dht.ready)t._dhtLookupAndAnnounce();else t.dht.on("ready",t._dhtLookupAndAnnounce.bind(t))}};p.prototype.stop=function(e){var t=this;var r=[];if(t.tracker&&t.tracker!==true){t.tracker.stop();r.push(function(e){t.tracker.destroy(e)})}if(!t._externalDHT&&t.dht&&t.dht!==true){r.push(function(e){t.dht.destroy(e)})}u(r,e)};p.prototype._createDHT=function(e){var t=this;if(!t._externalDHT)t.dht=new a;l(t.dht,t,["error","warning"]);t.dht.on("peer",function(e,r){if(r===t.infoHashHex)t.emit("peer",e)});if(!t._externalDHT)t.dht.listen(e)};p.prototype._createTracker=function(){var e=this;if(!e.tracker)return;var t=e.torrent||{infoHash:e.infoHashHex,announce:e.announce};var r={rtcConfig:e.rtcConfig,wrtc:e.wrtc};e.tracker=new c(e.peerId,e.port,t,r);l(e.tracker,e,["peer","warning","error"]);e.tracker.on("update",function(t){e.emit("trackerAnnounce",t)});e.tracker.start()};p.prototype._dhtLookupAndAnnounce=function(){var e=this;if(e._performedDHTLookup)return;e._performedDHTLookup=true;i("dht lookup");e.dht.lookup(e.infoHash,function(t){if(t||!e.port)return;i("dht announce");e.dht.announce(e.infoHash,e.port,function(){i("dht announce complete");e.emit("dhtAnnounce")})})}}).call(this,e("_process"),e("buffer").Buffer)},{_process:172,"bittorrent-dht/client":163,"bittorrent-tracker/client":29,buffer:164,debug:126,events:168,inherits:129,"re-emitter":99,"run-parallel":100,"xtend/mutable":130}],126:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":127,dup:8}],127:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:128}],128:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],129:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],130:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],131:[function(e,t,r){arguments[4][65][0].apply(r,arguments)},{buffer:164,dup:65,"is-typedarray":132}],132:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],133:[function(e,t,r){(function(r){var n=e("bencode");var i=e("bitfield");var a=e("events").EventEmitter;var s=e("inherits");var o=e("simple-sha1");var f=1e7;var u=1e3;var l=16*1024;t.exports=function(e){s(t,a);function t(t){a.call(this);this._wire=t;this._metadataComplete=false;this._metadataSize=null;this._remainingRejects=null;this._fetching=false;this._bitfield=new i(0,{grow:u});if(r.isBuffer(e)){this.setMetadata(e)}}t.prototype.name="ut_metadata";t.prototype.onHandshake=function(e,t,r){this._infoHash=e;this._infoHashHex=e.toString("hex")};t.prototype.onExtendedHandshake=function(e){if(!e.m||!e.m.ut_metadata){return this.emit("warning",new Error("Peer does not support ut_metadata"))}if(!e.metadata_size){return this.emit("warning",new Error("Peer does not have metadata"))}if(e.metadata_size>f){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var i=e.toString();var a=i.indexOf("ee")+2;t=n.decode(i.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=n.decode(e).info;if(t){e=n.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",n.encode({info:n.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var i=n.encode(e);if(r.isBuffer(t)){i=r.concat([i,t])}this._wire.extended("ut_metadata",i)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var n={msg_type:1,piece:e};if(typeof r==="number"){n.total_size=r}this._send(n,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var n=this.metadata.slice(t,r);this._data(e,n,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:134,bitfield:138,buffer:164,events:168,inherits:139,"simple-sha1":140}],134:[function(e,t,r){arguments[4][3][0].apply(r,arguments)},{"./lib/decode":135,"./lib/encode":137,dup:3}],135:[function(e,t,r){arguments[4][4][0].apply(r,arguments)},{"./dict":136,buffer:164,dup:4}],136:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{dup:5}],137:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{buffer:164,dup:6}],138:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],139:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],140:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:141}],141:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],142:[function(e,t,r){var n=e("debug")("webtorrent:append-to");var i=e("dezalgo");var a=e("./media-stream");var s=e("path");var o=e("videostream");var f=[".mp4",".m4v",".m4a"];var u=[".mp4",".m4v",".webm"];var l=[".m4a",".mp3"];var c=u.concat(l);var p=[".wav",".aac",".ogg",".oga"];var d=[".jpg",".png",".gif",".bmp"];var h=[".css",".html",".js",".md",".pdf",".txt"];var m=typeof window!=="undefined"&&window.MediaSource;t.exports=function v(e,t,r){r=i(r||function(){});var l;var v=s.extname(e.name).toLowerCase();var g=0;if(t&&(t.nodeName==="VIDEO"||t.nodeName==="AUDIO")){throw new Error("Invalid video/audio node argument. Argument must be root element that "+"video/audio tag will be appended to.")}if(c.indexOf(v)>=0)y();else if(p.indexOf(v)>=0)b();else if(d.indexOf(v)>=0)w();else if(h.indexOf(v)>=0)x();else r(new Error('Unsupported file type "'+v+'": Cannot append to DOM'));function y(){if(!m){return r(new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var i=u.indexOf(v)>=0?"video":"audio";if(f.indexOf(v)>=0)s();else c();function s(){n("Use `videostream` package for "+e.name);y();l.addEventListener("error",d);l.addEventListener("playing",_);o(e,l)}function c(){n("Use MediaSource API for "+e.name);y();l.addEventListener("error",h);l.addEventListener("playing",_);e.createReadStream().pipe(new a(l,{extname:v}));if(g)l.currentTime=g}function p(){n("Use Blob URL for "+e.name);y();l.addEventListener("error",k);l.addEventListener("playing",_);e.getBlobURL(function(e,t){if(e)return k(e);l.src=t;if(g)l.currentTime=g})}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e);l.removeEventListener("error",d);l.removeEventListener("playing",_);c()}function h(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e);l.removeEventListener("error",h);l.removeEventListener("playing",_);p()}function y(e){if(!l){l=document.createElement(i);l.controls=true;l.autoplay=true;l.play();l.addEventListener("progress",function(){g=l.currentTime});t.appendChild(l)}}}function _(){l.removeEventListener("playing",_);r(null,l)}function b(){l=document.createElement("audio");l.controls=true;l.autoplay=true;t.appendChild(l);e.getBlobURL(function(e,t){if(e)return k(e);l.addEventListener("error",k);l.addEventListener("playing",_);l.src=t;l.play()})}function w(){e.getBlobURL(function(n,i){if(n)return k(n);l=document.createElement("img");l.src=i;l.alt=e.name;t.appendChild(l);r(null)})}function x(){e.getBlobURL(function(e,n){if(e)return k(e);l=document.createElement("iframe");l.src=n;if(v!==".pdf")l.sandbox="allow-forms allow-scripts";t.appendChild(l);r(null)})}function k(t){if(l)l.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;n(t.message);if(r)r(t)}}},{"./media-stream":144,debug:202,dezalgo:205,path:171,videostream:229}],143:[function(e,t,r){t.exports=s;var n=e("debug")("webtorrent:file-stream");var i=e("inherits");var a=e("stream");i(s,a.Readable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);a.Readable.call(r,t);n("new filestream %s",JSON.stringify(t));if(!t)t={};if(!t.start)t.start=0;if(!t.end)t.end=e.length-1;r.destroyed=false;r.length=t.end-t.start+1;var i=t.start+e.offset;var o=t.pieceLength;r.startPiece=i/o|0;r.endPiece=(t.end+e.offset)/o|0;r._storage=e.storage;r._piece=r.startPiece;r._missing=r.length;r._reading=false;r._notifying=false;r._criticalLength=Math.min(1024*1024/o|0,2);r._offset=i-r.startPiece*o}s.prototype._read=function(){var e=this;n("_read");if(e._reading)return;e._reading=true;e.notify()};s.prototype.notify=function(){var e=this;n("notify");if(!e._reading||e._missing===0)return;if(!e._storage.bitfield.get(e._piece)){return e._storage.emit("critical",e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._storage.read(e._piece++,function(r,i){e._notifying=false;if(e.destroyed)return;if(r){e._storage.emit("error",r);return e.destroy(r)}n("read %s (length %s) (err %s)",t,i.length,r&&r.message);if(e._offset){i=i.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],147:[function(e,t,r){t.exports=u;var n=e("debug")("webtorrent:server");var i=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=i.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){n("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var i=f.parse(t.url).pathname;if(i==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(i==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(i.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];n("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:202,http:191,mime:212,pump:216,"range-parser":218,url:201}],148:[function(e,t,r){(function(n,i){t.exports=r=A;var a=e("./append-to");var s=e("bitfield");var o=e("block-stream2");var f=e("debug")("webtorrent:storage");var u=e("dezalgo");var l=e("end-of-stream");var c=e("events").EventEmitter;var p=e("./file-stream");var d=e("inherits");var h=e("./mime.json");var m=e("multistream");var v=e("once");var g=e("path");var y=e("simple-sha1");var _=16*1024;var b=r.BLOCK_BLANK=0;var w=r.BLOCK_RESERVED=1;var x=r.BLOCK_WRITTEN=2;function k(){}d(S,c);function S(e,t,r,n){var i=this;c.call(i);if(!f.enabled)i.setMaxListeners(0);i.index=e;i.hash=t;i.noVerify=!!n;if(typeof r==="number"){i.buffer=null;i.length=r}else{i.buffer=r;i.length=r.length}i._reset()}S.prototype.readBlock=function(e,t,r){var n=this;r=u(r);if(!n.buffer||!n._verifyOffset(e)){return r(new Error("invalid block offset "+e))}r(null,n.buffer.slice(e,e+t))};S.prototype.writeBlock=function(e,t,r){var n=this;r=u(r);if(!n._verifyOffset(e)||!n._verifyBlock(e,t)){return r(new Error("invalid block "+e+":"+t.length))}n._lazyAllocBuffer();var i=e/_;if(n.blocks[i]===x){return r(null)}t.copy(n.buffer,e);n.blocks[i]=x;n.blocksWritten+=1;if(n.blocksWritten===n.blocks.length){n.verify()}r(null)};S.prototype.reserveBlock=function(e){var t=this;var r=t.blocks.length;for(var n=0;n0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("select",t,r,false)}};E.prototype.deselect=function(){var e=this;if(e.pieces.length>0){var t=e.pieces[0].index;var r=e.pieces[e.pieces.length-1].index;e.storage.emit("deselect",t,r,false)}};E.prototype.createReadStream=function(e){var t=this;if(!e)e={};if(e.pieceLength==null)e.pieceLength=t.pieceLength;var r=new p(t,e);t.storage.emit("select",r.startPiece,r.endPiece,true,r.notify.bind(r));l(r,function(){t.storage.emit("deselect",r.startPiece,r.endPiece,true)});return r};E.prototype.getBuffer=function(e){var t=this;e=u(v(e));var r;if(t.storage.buffer){var n=function(){r=t.storage.buffer.slice(t.offset,t.offset+t.length);e(null,r)};if(t.done)n();else t.once("done",n)}else{r=new i(t.length);var a=0;t.createReadStream().on("data",function(e){e.copy(r,a);a+=e.length}).on("end",function(){e(null,r)}).on("error",e)}};E.prototype.appendTo=function(e,t){var r=this;if(typeof window==="undefined")throw new Error("browser-only method");if(typeof e==="string")e=document.querySelector(e);a(r,e,t)};E.prototype.getBlobURL=function(e){var t=this;if(typeof window==="undefined")throw new Error("browser-only method");e=u(e);if(t._blobUrl)return e(null,t._blobUrl);if(t._blobUrlPending)return t.once("_blobUrl",e);t._blobUrlPending=true;t.getBuffer(function(r,n){t._blobUrlPending=false;if(r){e(r);t.emit("_blobUrl",r);return}var i=h[g.extname(t.name).toLowerCase()];var a=i?new window.Blob([n],{type:i}):new window.Blob([n]);t._blobUrl=window.URL.createObjectURL(a);e(null,t._blobUrl);t.emit("_blobUrl",null,t._blobUrl)})};E.prototype._checkDone=function(){var e=this;e.done=e.pieces.every(function(e){return e.verified});if(e.done){n.nextTick(function(){e.emit("done")})}};d(A,c);function A(e,t){var r=this;c.call(r);if(!f.enabled)r.setMaxListeners(0);if(!t)t={};r.bitfield=new s(e.pieces.length);r.done=false;r.closed=false;r.readonly=true;if(!t.nobuffer){r.buffer=new i(e.length)}var n=r.pieceLength=e.pieceLength;var a=e.lastPieceLength;var o=e.pieces.length;r.pieces=e.pieces.map(function(e,i){var s=i*n;var f=s+(i===o-1?a:n);var u=r.buffer?r.buffer.slice(s,f):f-s;var l=new S(i,e,u,!!t.noVerify);l.on("done",r._onPieceDone.bind(r,l));return l});r.files=e.files.map(function(e){var t=e.offset;var i=t+e.length-1;var a=t/n|0;var s=i/n|0;var o=r.pieces.slice(a,s+1);var f=new E(r,e,o,n);f.on("done",r._onFileDone.bind(r,f));return f})}A.BLOCK_LENGTH=_;A.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];t=v(t||function(){});var n=0;var i=new m(e);var a=new o(r.pieceLength,{zeroPadding:false});i.on("error",f);r.once("done",u);i.pipe(a).on("data",s).on("error",f);function s(e){var t=n;n+=1;var i=0;var a=new o(_,{zeroPadding:false});a.on("data",s);a.on("end",f);function s(e){var n=i*_;i+=1;r.writeBlock(t,n,e)}function f(){u()}function u(){a.removeListener("data",s);a.removeListener("end",f)}a.end(e)}function f(e){l();t(e)}function u(){l();t(null)}function l(){i.removeListener("error",f);a.removeListener("data",s);a.removeListener("error",f);r.removeListener("done",u)}};Object.defineProperty(A.prototype,"downloaded",{get:function(){var e=this;return e.pieces.reduce(function(e,t){return e+(t.verified?t.length:t.blocksWritten*_)},0)}});Object.defineProperty(A.prototype,"numMissing",{get:function(){var e=this;var t=e.pieces.length;for(var r=0,n=e.pieces.length;rt||e<0||t>=i.storage.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;s("select %s-%s (priority %s)",e,t,r);i._selections.push({from:e,to:t,offset:0,priority:r,notify:n||I});i._selections.sort(function(e,t){return t.priority-e.priority});i._updateSelections()};L.prototype.deselect=function(e,t,r){var n=this;r=Number(r)||0;s("deselect %s-%s (priority %s)",e,t,r);for(var i=0;i2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,n);if(r.unref)r.unref()}}var a=0;function o(){if(e.peerPieces.length!==t.storage.pieces.length)return;for(;aw){s("got invalid block size request %s (from %s)",i,e.remoteAddress+":"+e.remotePort);return e.destroy()}t.storage.readBlock(r,n,i,a)});e.bitfield(t.storage.bitfield);e.interested();r=setTimeout(i,n);if(r.unref)r.unref();e.isSeeder=false;o()};L.prototype._onStorage=function(){var e=this;if(e.destroyed)return;s("on storage");e.storage.readonly=false;e.select(0,e.storage.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),U);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();r.nextTick(function(){e.ready=true;e.emit("ready")})};L.prototype._onStoragePiece=function(e){var t=this;s("piece done %s",e.index);t._reservations[e.index]=null;t.swarm.wires.forEach(function(t){t.have(e.index)});t._gcSelections()};L.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};L.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var n=B(e,A);f(false)||f(true);function i(t,r,n,i){return function(a){return a>=t&&a<=r&&!(a in n)&&e.peerPieces.get(a)&&(!i||i(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var n=t._selections[r];var a;if(t.strategy==="rarest"){var s=n.from+n.offset;var o=n.to;var f=o-s+1;var u={};var l=0;var c=i(s,o,u);while(l=n.from+n.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>S)return function(){return true};var n=Math.max(1,e.requests.length)*b.BLOCK_LENGTH/r;var i=10;var a=0;return function(e){if(!i||t.storage.bitfield.get(e))return true;var s=t.storage.pieces[e];var o=s.blocks.length-s.blocksWritten;for(;a0)continue;i--;return false}return true}}function o(e){var r=e;for(var n=e;n=n)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var n=0;for(;n=S)continue;if(2*u>n||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=o)return false;var f=e.requests.length===0&&i.storage.numMissing<30;var u=i.storage.reserveBlock(t,f);if(!u&&!f&&n&&i._hotswap(e,t)){u=i.storage.reserveBlock(t,false)}if(!u)return false;var l=i._reservations[t];if(!l){l=i._reservations[t]=[]}var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;function p(n,a){if(!i.ready){i.once("ready",function(){p(n,a)});return}if(l[c]===e)l[c]=null;if(n){s("error getting piece %s (offset: %s length: %s) from %s: %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort,n.message);i.storage.cancelBlock(t,u.offset);r.nextTick(i._update.bind(i));return false}else{s("got piece %s (offset: %s length: %s) from %s",t,u.offset,u.length,e.remoteAddress+":"+e.remotePort);i.storage.writeBlock(t,u.offset,a,function(e){if(e){s("error writing block");i.storage.cancelBlock(t,u.offset)}r.nextTick(i._update.bind(i))})}}e.request(t,u.offset,u.length,p);return true};L.prototype.createServer=function(e){var t=this;if(typeof _==="function"){var r=new _(t,e);t._servers.push(r);return r}};L.prototype._onError=function(e){var t=this;s("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function B(e,t){return Math.ceil(2+t*e.downloadSpeed()/b.BLOCK_LENGTH)}function C(e){return Math.random()*e|0}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./rarity-map":146,"./server":147,"./storage":148,_process:172,"addr-to-ip-port":1,"bittorrent-swarm":15,"create-torrent":43,debug:202,events:168,inherits:211,"parse-torrent":94,"random-iterate":217,"re-emitter":99,"run-parallel":100,"torrent-discovery":125,uniq:222,ut_metadata:133,ut_pex:163}],150:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{buffer:164,dup:7}],151:[function(e,t,r){arguments[4][48][0].apply(r,arguments)},{buffer:164,defined:152,dup:48,inherits:211,"readable-stream":161}],152:[function(e,t,r){arguments[4][49][0].apply(r,arguments)},{dup:49}],153:[function(e,t,r){arguments[4][51][0].apply(r,arguments)},{"./_stream_readable":155,"./_stream_writable":157,_process:172,"core-util-is":158,dup:51,inherits:211}],154:[function(e,t,r){arguments[4][52][0].apply(r,arguments)},{"./_stream_transform":156,"core-util-is":158,dup:52,inherits:211}],155:[function(e,t,r){arguments[4][53][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:53,events:168,inherits:211,isarray:159,stream:190,"string_decoder/":160,util:163}],156:[function(e,t,r){arguments[4][54][0].apply(r,arguments)},{"./_stream_duplex":153,"core-util-is":158,dup:54,inherits:211}],157:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{"./_stream_duplex":153,_process:172,buffer:164,"core-util-is":158,dup:55,inherits:211,stream:190}],158:[function(e,t,r){arguments[4][56][0].apply(r,arguments)},{buffer:164,dup:56}],159:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],160:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],161:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{"./lib/_stream_duplex.js":153,"./lib/_stream_passthrough.js":154,"./lib/_stream_readable.js":155,"./lib/_stream_transform.js":156,"./lib/_stream_writable.js":157,dup:59,stream:190}],162:[function(e,t,r){},{}],163:[function(e,t,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],164:[function(e,t,r){var n=e("base64-js");var i=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=_;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new ArrayBuffer(0);var r=new Uint8Array(t);r.foo=function(){return 42};r.constructor=e;return r.foo()===42&&r.constructor===e&&typeof r.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(n){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){ -if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=g(e,t<0?0:y(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function y(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function _(e,t){if(!(this instanceof _))return new _(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function J(e){return!!(e!=null&&e._isBuffer)};f.compare=function Q(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;var i=0;var a=Math.min(r,n);while(i>>1;case"base64":return K(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase();n=true}}}f.byteLength=b;f.prototype.length=undefined;f.prototype.parent=undefined;function w(e,t,r){var n=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return L(this,t,r);case"binary":return B(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}f.prototype.toString=function re(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return I(this,0,e);return w.apply(this,arguments)};f.prototype.equals=function ne(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function ie(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function se(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var n=-1;for(var i=0;r+ii){n=i}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(n>a/2){n=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!n)n="utf8";var s=false;for(;;){switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return k(this,e,t,r);case"ascii":return S(this,e,t,r);case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();s=true}}};f.prototype.toJSON=function le(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function I(e,t,r){var n="";var i="";r=Math.min(e.length,r);for(var a=t;an)r=n;var i="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function pe(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a0&&(i*=256)){n+=this[e+--t]*i}return n};f.prototype.readUInt8=function he(e,t){if(!t)P(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function me(e,t){if(!t)P(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ve(e,t){if(!t)P(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function ge(e,t){if(!t)P(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function ye(e,t){if(!t)P(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function _e(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a=i)n-=Math.pow(2,8*t);return n};f.prototype.readIntBE=function be(e,t,r){e=e|0;t=t|0;if(!r)P(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function we(e,t){if(!t)P(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function xe(e,t){if(!t)P(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function ke(e,t){if(!t)P(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Se(e,t){if(!t)P(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ee(e,t){if(!t)P(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ae(e,t){if(!t)P(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ue(e,t){if(!t)P(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Te(e,t){if(!t)P(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Ie(e,t){if(!t)P(e,8,this.length);return i.read(this,e,false,52,8)};function z(e,t,r,n,i,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Le(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n)z(this,e,t,r,Math.pow(2,8*r),0);var i=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+i]=e/a&255}return t+r};f.prototype.writeUInt8=function Ce(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function O(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}}f.prototype.writeUInt16LE=function Re(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Pe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};function F(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}}f.prototype.writeUInt32LE=function ze(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{F(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};f.prototype.writeIntLE=function Fe(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function Me(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);z(this,e,t,r,i-1,-i)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function je(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function De(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{O(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function Ne(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{O(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function He(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{F(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function qe(e,t,r){e=+e;t=t|0;if(!r)z(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{F(this,e,t,false)}return t+4};function M(e,t,r,n,i,a){if(t>i||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function j(e,t,r,n,a){if(!a){M(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}f.prototype.writeFloatLE=function Ge(e,t,r){return j(this,e,t,true,r)};f.prototype.writeFloatBE=function We(e,t,r){return j(this,e,t,false,r)};function D(e,t,r,n,a){if(!a){M(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function Ve(e,t,r){return D(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ye(e,t,r){return D(this,e,t,false,r)};f.prototype.copy=function $e(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var n;if(typeof e==="number"){for(n=t;n55295&&r<57344){if(i){if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}else{r=i-55296<<10|r-56320|65536;i=null}}else{if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)a.push(239,191,189);continue}else{i=r;continue}}}else if(i){if((t-=3)>-1)a.push(239,191,189);i=null}if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<2097152){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Y(e){var t=[];for(var r=0;r>8;i=r%256;a.push(i);a.push(n)}return a}function K(e){return n.toByteArray(q(e))}function Z(e,t,r,n){for(var i=0;i=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function X(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}},{"base64-js":165,ieee754:166,"is-array":167}],165:[function(e,t,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var i="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===i||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);i=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,n=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,i="",a,s;function o(e){return n.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);i+=o(a<<4&63);i+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];i+=o(a>>10);i+=o(a>>4&63);i+=o(a<<2&63);i+="=";break}return i}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],166:[function(e,t,r){r.read=function(e,t,r,n,i){var a,s;var o=i*8-n-1;var f=(1<>1;var l=-7;var c=r?i-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);a=a-u}return(d?-1:1)*s*Math.pow(2,a-n)};r.write=function(e,t,r,n,i,a){var s,o,f;var u=a*8-i-1;var l=(1<>1;var p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:a-1;var h=n?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,i);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=o&255,d+=h,o/=256,i-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],167:[function(e,t,r){var n=Array.isArray;var i=Object.prototype.toString;t.exports=n||function(e){return!!e&&"[object Array]"==i.call(e)}},{}],168:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:n=arguments.length;a=new Array(n-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(i(e._events[t]))r=1;else r=e._events[t].length;return r};function i(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],169:[function(e,t,r){var n=e("http");var i=t.exports;for(var a in n){if(n.hasOwnProperty(a))i[a]=n[a]}i.request=function(e,t){if(!e)e={};e.scheme="https";return n.request.call(this,e,t)}},{http:191}],170:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],171:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var n=e.length-1;n>=0;n--){var i=e[n];if(i==="."){e.splice(n,1)}else if(i===".."){e.splice(n,1);r++}else if(r){e.splice(n,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var i=function(e){return n.exec(e).slice(1)};r.resolve=function(){var r="",n=false;for(var i=arguments.length-1;i>=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;n=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!n).join("/");return(n?"/":"")+r||"."};r.normalize=function(e){var n=r.isAbsolute(e),i=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!n).join("/");if(!e&&!n){e="."}if(e&&i){e+="/"}return(n?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function n(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var i=n(e.split("/"));var a=n(t.split("/"));var s=Math.min(i.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var n=[];while(r--){n[r]=t(e[r])}return n}function T(e,t){var r=e.split("@");var n="";if(r.length>1){n=r[0]+"@";e=r[1]}e=e.replace(b,".");var i=e.split(".");var a=U(i,t).join(".");return n+a}function I(e){var t=[],r=0,n=e.length,i,a;while(r=55296&&i<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var n=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;n+=l){e=k(e/x)}return k(n+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,n,i=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-i)/y)){A("overflow")}i+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}n=t.length+1;s=R(i-h,n,h==0);if(k(i/n)>u-a){A("overflow")}a+=k(i/n);i%=n;t.splice(i++,0,a)}return L(t)}function z(e){var t,r,n,i,a,s,o,f,d,h,y,_=[],b,w,x,E;e=I(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!n(s,m)){s[m]=v}else if(i(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],175:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(n(s))+r;if(i(e[s])){return a(e[s],function(e){return o+encodeURIComponent(n(e))}).join(t); -}else{return o+encodeURIComponent(n(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(n(o))+r+encodeURIComponent(n(e))};var i=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!i&&!n)r=t.decoder.write(r);if(!i)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!i){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var n=t.needReadable;u("need readable",n);if(t.length===0||t.length-e0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(i!==null)this.emit("data",i);return i};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;n(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=n){if(i)o=r.join("");else o=a.concat(r,n);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;n(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,n=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new i(t,r)}return t}function h(e,t,r,n,a){r=d(t,r,n);if(i.isBuffer(r))n="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new n(a.length);for(var o=0;oe._pos){e.push(new n(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":192,_process:172,buffer:164,foreach:196,inherits:211,stream:190}],195:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],196:[function(e,t,r){var n=Object.prototype.hasOwnProperty;var i=Object.prototype.toString; -t.exports=function a(e,t,r){if(i.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!n.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&n.call(e.callee)==="[object Function]"}return r}},{}],200:[function(e,t,r){arguments[4][58][0].apply(r,arguments)},{buffer:164,dup:58}],201:[function(e,t,r){var n=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=i;function i(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof i)return e;var n=new i;n.parse(e,t,r);return n}i.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var i=e;i=i.trim();var s=a.exec(i);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;i=i.substr(s.length)}if(r||s||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=i.substr(0,2)==="//";if(f&&!(s&&v[s])){i=i.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){i="/"+R.join(".")+i}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};i.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:173,querystring:176}],202:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{"./debug":203,dup:8}],203:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9,ms:204}],204:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],205:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{asap:206,dup:23,wrappy:208}],206:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"./raw":207,dup:24}],207:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],208:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{dup:26}],209:[function(e,t,r){var n=e("once");var i=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=n(r||i);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:215}],210:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],211:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12}],212:[function(e,t,r){(function(r){var n=e("path");var i=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var n=e[t];for(var i=0;i0;return l(i,s,o,function(e){if(!r)r=e;if(e)n.forEach(c);if(s)return;n.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":209,fs:162,once:215}],217:[function(e,t,r){var n=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var n=Math.random()*r|0;var i=e[t+n];var a=e[t];e[t]=i;e[t+n]=a;t++;return i}};t.exports=n},{}],218:[function(e,t,r){t.exports=function(e,t){var r=true;var n=t.indexOf("=");if(-1==n)return-2;var i=t.slice(n+1).split(",").map(function(t){var t=t.split("-"),n=parseInt(t[0],10),i=parseInt(t[1],10);if(isNaN(n)){n=e-i;i=e-1}else if(isNaN(i)){i=e-1}if(i>e-1)i=e-1;if(isNaN(n)||isNaN(i)||n>i||n<0)r=false;return{start:n,end:i}});i.type=t.slice(0,n);return r?i:-1}},{}],219:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,rusha:220}],220:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{dup:78}],221:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dup:13}],222:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],223:[function(e,t,r){var n=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?n.LITTLE_ENDIAN:r};t.exports=n;n.prototype={};n.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var n=r.createObjectURL(t);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click();r.revokeObjectURL(n)}else{throw"DataStream.save: Can't create object URL."}};n.BIG_ENDIAN=false;n.LITTLE_ENDIAN=true;n.prototype._dynamicSize=true;Object.defineProperty(n.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});n.prototype._byteLength=0;Object.defineProperty(n.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(n.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(n.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});n.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var n=new ArrayBuffer(r);var i=new Uint8Array(this._buffer);var a=new Uint8Array(n,0,i.length);a.set(i);this.buffer=n;this._byteLength=t};n.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};n.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var n=new Uint8Array(this._buffer,e,r.length);r.set(n);this.buffer=t;this.position-=e};n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};n.prototype.isEof=function(){return this.position>=this._byteLength};n.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};n.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};n.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};n.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);n.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};n.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);n.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};n.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);n.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);n.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};n.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){n.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;n.memcpy=function(e,t,r,n,i){var a=new Uint8Array(e,t,i);var s=new Uint8Array(r,n,i);a.set(s)};n.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};n.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};n.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;ri;n--,i++){var a=t[i];t[i]=t[n];t[n]=a}}return e};n.prototype.failurePosition=0;n.prototype.readStruct=function(e){var t={},r,n,i;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};n.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],224:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]], -sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(n);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:i}}if(o[f+"Box"]){r=new o[f+"Box"](a-i)}else{if(t){r=new o.SampleEntry(f,a-i)}else{r=new o.Box(f,a-i)}}r.hdr_size=i;r.start=n;r.fileStart=n+e.buffer.fileStart;r.parse(e);e.seek(n+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var n;n=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var n;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var n;var i;this.configurationVersion=e.readUint8();i=e.readUint8();this.general_profile_space=i>>6;this.general_tier_flag=(i&32)>>5;this.general_profile_idc=i&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();i=e.readUint8();this.constantFrameRate=i>>6;this.numTemporalLayers=(i&13)>>3;this.temporalIdNested=(i&4)>>2;this.lengthSizeMinusOne=i&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=i&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(n,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var i=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||i){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;i=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,i,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=i},{"./log":227}],226:[function(e,t,r){var n=e("./box");var i=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=n.parseOneBox(this.stream);if(t.code===n.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new n[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var n=null;var i=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+i);return i}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var n;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new n.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new n.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,n,i,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){n.samples[t-1].duration=o.sample_deltas[y];k.dts=n.samples[t-1].dts+n.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=n.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)n.samples[t-1].duration=n.mdia.mdhd.duration-n.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var i,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&n.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&n.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&n.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&n.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&n.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(i>=s){console.info("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,i){if(r>=s){console.warn("["+n.getDurationString(new Date-e,1e3)+"]","["+t+"]",i)}},e:function(r,i){if(t>=s){console.error("["+n.getDurationString(new Date-e,1e3)+"]","["+r+"]",i)}}};return o}();t.exports=n;n.getDurationString=function(e,t){function r(e,t){var r=""+e;var n=r.split(".");while(n[0].length0){var r="";for(var i=0;i0)r+=",";r+="["+n.getDurationString(e.start(i))+","+n.getDurationString(e.end(i))+"]"}return r}else{return"(empty)"}}},{}],228:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.fragmentedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.segmentStream=null;i.nb_samples=1e3;i.rapAlignement=true;if(r){if(r.nbSamples)i.nb_samples=r.nbSamples;if(r.rapAlignement)i.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var n=this.inputIsoFile.getTrackById(e);if(n){var i={};this.extractedTracks.push(i);i.id=e;i.user=t;i.trak=n;n.nextSample=0;i.nb_samples=1e3;i.samples=[];if(r){if(r.nbSamples)i.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var n;n=new Uint8Array(r);n.set(new Uint8Array(e,t,r));n.buffer.fileStart=e.fileStart+t;n.buffer.usedBytes=0;return n.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;rn.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=n.fileStart){}else{e=this.reduceBuffer(e,0,n.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,i,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+i.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(i.id,i.user,i.samples)}i.samples=[];if(i!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var n=this.getInfo();this.readySent=true;this.onReady(n)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var i=this.inputIsoFile.findPosition(true,t);if(i!==-1){t=this.inputIsoFile.findEndContiguousBuf(i)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*i.timescale){f=r.samples[n-1].offset;l=n-1;break}if(t&&i.is_rap){a=i.offset;s=i.cts;u=n}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var n;var i;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;ai){break}else if(o>=0||i<=l){o=l}}var c=o-i;if(c<0)c=0;n("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new i;m.onError=function(e){n("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){n("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var n={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,n));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=n}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,n){var i=g[e];S(i,r,n===i.meta.nb_samples);if(e===f&&u){u.push(r);if(n>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var i={start:y,end:e.length-1};_=e.createReadStream(i);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(i){n("MP4Box threw exception: %s",i.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){n("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);n("Seeking to time: %d",e);n("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(i){n("SourceBuffer error: %s",i.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var n=URL.createObjectURL(r);var i=document.createElement("a");i.setAttribute("href",n);i.setAttribute("download",e);i.click()}},{debug:202,mp4box:228}],230:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],231:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.57.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/fs-storage":false,"./lib/server":false,"bittorrent-dht/client":false,"load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","block-stream2":"^1.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0",dezalgo:"^1.0.1","end-of-stream":"^1.0.0",executable:"^1.1.0",hat:"0.0.3",inherits:"^2.0.1",inquirer:"^0.8.0","load-ip-set":"^1.0.3",mime:"^1.2.11",minimist:"^1.1.0",mkdirp:"^0.5.0",moment:"^2.8.3",multistream:"^1.4.2","network-address":"^1.0.0",once:"^1.3.1","parse-torrent":"^5.1.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-access-file":"^0.3.1","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0",rimraf:"^2.2.5","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0" -},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^4.0.1",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],232:[function(e,t,r){(function(r,n,i){t.exports=k;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/fs-storage");var _=e("./lib/storage");var b=e("./lib/torrent");c(k,f);var w=e("./package.json").version;var x=w.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function k(e){var t=this;if(!(t instanceof k))return new k(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||n.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.storage=typeof e.storage==="function"?e.storage:e.storage!==false&&typeof y==="function"?y:_;t.peerId=e.peerId===undefined?new i("-WW"+x+"-"+l(48),"utf8"):typeof e.peerId==="string"?new i(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new i(l(160),"hex"):typeof e.nodeId==="string"?new i(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e)return t.error("failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(k.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});k.prototype.get=function(e){var t=this;if(e instanceof b)return e;var r;try{r=h(e)}catch(n){return null}if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var i=0,a=t.torrents.length;i0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}]},{},[232])(232)}); +(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{"./media-stream":4,_process:49,debug:121,path:48,videostream:180}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],7:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:121,http:68,mime:131,pump:148,"range-parser":152,url:78}],8:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var O=5e3;var z=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r._path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){return this.swarm?this.swarm.downloaded:0}});Object.defineProperty(H.prototype,"uploaded",{get:function(){return this.swarm?this.swarm.uploaded:0}});Object.defineProperty(H.prototype,"progress",{get:function(){return this.length?this.downloaded/this.length:0}});Object.defineProperty(H.prototype,"ratio",{get:function(){return this.uploaded/(this.downloaded||1)}});Object.defineProperty(H.prototype,"numPeers",{get:function(){return this.swarm?this.swarm.numPeers:0}});Object.defineProperty(H.prototype,"torrentFileURL",{get:function(){if(typeof window==="undefined")throw new Error("browser-only property");if(!this.torrentFile)return null;return window.URL.createObjectURL(new window.Blob([this.torrentFile],{type:"application/x-bittorrent"}))}});H.prototype.downloadSpeed=function(){return this.swarm?this.swarm.downloadSpeed():0};H.prototype.uploadSpeed=function(){return this.swarm?this.swarm.uploadSpeed():0};H.prototype._onTorrentId=function(e){var t=this;if(t.destroyed)return;y.remote(e,function(e,r){if(t.destroyed)return;if(e)return t._onError(e);t._onParsedTorrent(r)})};H.prototype._onParsedTorrent=function(e){var t=this;if(t.destroyed)return;t._processParsedTorrent(e);if(!t.infoHash){return t._onError(new Error("Malformed torrent data: No info hash"))}if(!t._path)t._path=_.join(N,t.infoHash);t.swarm=new A(t.infoHash,t.client.peerId,{handshake:{dht:!!t.client.dht}});t.swarm.on("error",t._onError.bind(t));t.swarm.on("wire",t._onWire.bind(t));t.swarm.on("download",function(e){t.client.downloadSpeed(e);t.client.emit("download",e);t.emit("download",e)});t.swarm.on("upload",function(e){t.client.uploadSpeed(e);t.client.emit("upload",e);t.emit("upload",e)});t.swarm.listen(t.client.torrentPort,t._onSwarmListening.bind(t));r.nextTick(function(){if(t.destroyed)return;t.emit("infoHash",t.infoHash)})};H.prototype._processParsedTorrent=function(e){if(this.announce){e.announce=e.announce.concat(this.announce)}if(i.WEBTORRENT_ANNOUNCE){e.announce=e.announce.concat(i.WEBTORRENT_ANNOUNCE)}if(e.announce.length===0){e.announce=o.announceList.map(function(e){return e[0]})}if(this.urlList){e.urlList=e.urlList.concat(this.urlList)}U(e.announce);c(this,e);this.magnetURI=y.toMagnetURI(e);this.torrentFile=y.toTorrentFile(e)};H.prototype._onSwarmListening=function(){var e=this;if(e.destroyed)return;if(e.swarm.server)e.client.torrentPort=e.swarm.address().port;e.discovery=new u({announce:e.announce,dht:e.client.dht,tracker:e.client.tracker,peerId:e.client.peerId,port:e.client.torrentPort,rtcConfig:e.client._rtcConfig,wrtc:e.client._wrtc});e.discovery.on("error",e._onError.bind(e));e.discovery.setTorrent(e.infoHash);e.discovery.on("peer",e.addPeer.bind(e));S(e.discovery,e,["trackerAnnounce","dhtAnnounce","warning"]);if(e.info)e._onMetadata(e);e.emit("listening",e.client.torrentPort)};H.prototype._onMetadata=function(e){var t=this;if(t.metadata||t.destroyed)return;f("got metadata");var i;if(e&&e.infoHash){i=e}else{try{i=y(e)}catch(n){return t._onError(n)}}t._processParsedTorrent(i);t.metadata=t.torrentFile;t.discovery.setTorrent(t);if(t.urlList)t.urlList.forEach(t.addWebSeed.bind(t));t.rarityMap=new B(t.swarm,t.pieces.length);t.store=new d(new t._store(t.pieceLength,{files:t.files.map(function(e){return{path:_.join(t._path,e.path),length:e.length,offset:e.offset}}),length:t.length}));t.files=t.files.map(function(e){return new L(t,e)});t._hashes=t.pieces;t.pieces=t.pieces.map(function(e,r){var i=r===t.pieces.length-1?t.lastPieceLength:t.pieceLength;return new w(i)});t._reservations=t.pieces.map(function(){return[]});t.bitfield=new a(t.pieces.length);t.swarm.wires.forEach(function(e){if(e.ut_metadata)e.ut_metadata.setMetadata(t.metadata);t._onWireWithMetadata(e)});r.nextTick(function(){t.emit("metadata");t._onStore()})};H.prototype._onStore=function(){var e=this;if(e.destroyed)return;f("on store");e.select(0,e.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),j);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();e.ready=true;e.emit("ready")};H.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;f("destroy");t.client.remove(t);if(t._rechokeIntervalId){clearInterval(t._rechokeIntervalId);t._rechokeIntervalId=null}var r=[];t._servers.forEach(function(e){r.push(function(t){e.destroy(t)})});if(t.swarm)r.push(function(e){t.swarm.destroy(e)});if(t.discovery)r.push(function(e){t.discovery.stop(e)});if(t.store)r.push(function(e){t.store.close(e)});g(r,e)};H.prototype.addPeer=function(e){var t=this;function r(){t.swarm.addPeer(e);t.emit("peer",e)}if(typeof e==="string"&&t.client.blocked&&t.client.blocked.contains(n(e)[0])){t.numBlockedPeers+=1;t.emit("blockedPeer",e);return false}else{if(t.swarm)r();else t.once("listening",r);return true}};H.prototype.addWebSeed=function(e){var t=this;t.swarm.addWebSeed(e,t)};H.prototype.select=function(e,t,r,i){var n=this;if(e>t||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,O);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,O);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>z)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=z)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._onPiece()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._onPiece=function(){var e=this;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r.bitfield.set(t,true)});r._onPiece();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C==="function"){var r=new C(t,e);t._servers.push(r);return r}};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":6,"./server":7,_process:49,"addr-to-ip-port":9,bitfield:10,"bittorrent-swarm":11,"chunk-store-stream/write":90,"create-torrent":91,debug:121,events:44,"fs-chunk-store":130,"immediate-chunk-store":128,inherits:129,multistream:133,os:47,"parse-torrent":134,path:48,"path-exists":147,pump:148,"random-iterate":151,"re-emitter":153,"run-parallel":154,"simple-sha1":163,"torrent-discovery":166,"torrent-piece":167,uniq:168,ut_metadata:169,ut_pex:39,"xtend/mutable":182}],9:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],10:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":12,"./lib/tcp-pool":13,_process:49,"addr-to-ip-port":39,buffer:40,debug:121,dezalgo:20,events:44,inherits:129,net:39,speedometer:165}],12:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":14,"bittorrent-protocol":15,debug:121}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":12,_process:49,debug:121,dezalgo:20,net:39}],14:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:10,"bittorrent-protocol":15,buffer:40,debug:121,inherits:129,"simple-get":159}],15:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:40,debug:121,"get-browser-rtc":32,hat:127,inherits:129,"is-typedarray":33,once:30,stream:67,"typedarray-to-buffer":34}],32:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],33:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],34:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:40,"is-typedarray":33}],35:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:40,debug:121,inherits:129,"is-typedarray":36,stream:67,"typedarray-to-buffer":37,ws:39}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],37:[function(e,t,r){arguments[4][34][0].apply(r,arguments)},{buffer:40,dup:34,"is-typedarray":36}],38:[function(e,t,r){},{}],39:[function(e,t,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],40:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){ +e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":41,ieee754:42,"is-array":43}],41:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],42:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],43:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],44:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],45:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:68}],46:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],47:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],48:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function O(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],52:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":69,_process:49,buffer:40,foreach:73,inherits:129,stream:67}],72:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],73:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],77:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:40}],78:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var O=this.hostname.split(".");var z=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:50,querystring:53}],79:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:40,defined:80,inherits:129,"readable-stream":89}],80:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:92,"block-stream2":96,buffer:40,dezalgo:107,"filestream/read":113,flatten:114,fs:38,"is-file":115,junk:116,multistream:133,once:118,path:48,"piece-length":119,"run-parallel":154,"simple-sha1":163,stream:67}],92:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./lib/decode":93,"./lib/encode":95,dup:16}],93:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./dict":94,buffer:40,dup:17}],94:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],95:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{buffer:40,dup:19}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{buffer:40,defined:97,dup:79,inherits:129,"readable-stream":106}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_readable":100,"./_stream_writable":102,_process:49,"core-util-is":103,dup:81,inherits:129}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_transform":101,"core-util-is":103,dup:82,inherits:129}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":98,_process:49,buffer:40,"core-util-is":103,dup:83,events:44,inherits:129,isarray:104,stream:67,"string_decoder/":105,util:39}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":98,"core-util-is":103,dup:84,inherits:129}],102:[function(e,t,r){arguments[4][85][0].apply(r,arguments)},{"./_stream_duplex":98,_process:49,buffer:40,"core-util-is":103,dup:85,inherits:129,stream:67}],103:[function(e,t,r){arguments[4][60][0].apply(r,arguments)},{buffer:40,dup:60}],104:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],105:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{buffer:40,dup:77}],106:[function(e,t,r){arguments[4][89][0].apply(r,arguments)},{"./lib/_stream_duplex.js":98,"./lib/_stream_passthrough.js":99,"./lib/_stream_readable.js":100,"./lib/_stream_transform.js":101,"./lib/_stream_writable.js":102,dup:89,stream:67}],107:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{asap:108,dup:20,wrappy:110}],108:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{"./raw":109,dup:21}],109:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],110:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23}],111:[function(e,t,r){arguments[4][34][0].apply(r,arguments)},{buffer:40,dup:34,"is-typedarray":112}],112:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],113:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:129,stream:67,"typedarray-to-buffer":111}],114:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],121:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":122}],122:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],128:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:49}],129:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],130:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:49}],131:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:40,"thirty-two":140,uniq:168,xtend:181}],140:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":141}],141:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:40}],142:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":124,fs:38,once:150}],149:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23}],150:[function(e,t,r){arguments[4][30][0].apply(r,arguments)},{dup:30,wrappy:149}],151:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],152:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],153:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:44}],154:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:155}],155:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{asap:156,dup:20,wrappy:158}],156:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{"./raw":157,dup:21}],157:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],158:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23}],159:[function(e,t,r){(function(r){t.exports=u;var i=e("http");var n=e("https");var a=e("once");var s=e("url");var o=e("unzip-response");var f=e("object-assign");function u(e,t){e=typeof e==="string"?{url:e}:f({},e);t=a(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var s=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!s)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?n:i;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:40,http:68,https:45,"object-assign":160,once:162,"unzip-response":39,url:78}],160:[function(e,t,r){"use strict";var i=Object.prototype.propertyIsEnumerable;function n(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return i.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var i;var s=n(e);for(var o=1;o>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:164}],164:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:170,bitfield:10,buffer:40,events:44,inherits:129,"simple-sha1":163}],170:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./lib/decode":171,"./lib/encode":173,dup:16}],171:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./dict":172,buffer:40,dup:17}],172:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],173:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{buffer:40,dup:19}],174:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],175:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":178}],177:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.58.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Sun, 23 Aug 2015 21:17:59 +0200 Subject: [PATCH 059/109] use "mediasource" package (published from lib/media-stream.js) --- lib/append-to.js | 2 +- lib/media-stream.js | 86 --------------------------------------------- package.json | 1 + 3 files changed, 2 insertions(+), 87 deletions(-) delete mode 100644 lib/media-stream.js diff --git a/lib/append-to.js b/lib/append-to.js index a8294dd1..8976e56d 100644 --- a/lib/append-to.js +++ b/lib/append-to.js @@ -1,5 +1,5 @@ var debug = require('debug')('webtorrent:append-to') -var MediaSourceStream = require('./media-stream') +var MediaSourceStream = require('mediasource') var path = require('path') var videostream = require('videostream') diff --git a/lib/media-stream.js b/lib/media-stream.js deleted file mode 100644 index d602da54..00000000 --- a/lib/media-stream.js +++ /dev/null @@ -1,86 +0,0 @@ -// TODO: publish this as a standalone module - -module.exports = MediaSourceStream - -var debug = require('debug')('webtorrent:media-source-stream') -var inherits = require('inherits') -var stream = require('stream') - -var MediaSource = typeof window !== 'undefined' && window.MediaSource - -inherits(MediaSourceStream, stream.Writable) - -function MediaSourceStream (elem, opts) { - var self = this - if (!(self instanceof MediaSourceStream)) return new MediaSourceStream(elem, opts) - stream.Writable.call(self, opts) - - if (!MediaSource) throw new Error('web browser lacks MediaSource support') - if (!opts) opts = {} - debug('new MediaSourceStream %s %s', elem, JSON.stringify(opts)) - - self._elem = elem - self._mediaSource = new MediaSource() - self._sourceBuffer = null - self._cb = null - - self._type = opts.type || getType(opts.extname) - if (!self._type) throw new Error('missing `opts.type` or `opts.extname` options') - - self._elem.src = window.URL.createObjectURL(self._mediaSource) - - self._mediaSource.addEventListener('sourceopen', function () { - if (MediaSource.isTypeSupported(self._type)) { - self._sourceBuffer = self._mediaSource.addSourceBuffer(self._type) - self._sourceBuffer.addEventListener('updateend', self._flow.bind(self)) - self._flow() - } else { - self._mediaSource.endOfStream('decode') - } - }) - - self.on('finish', function () { - debug('finish') - self._mediaSource.endOfStream() - }) - window.vs = self -} - -MediaSourceStream.prototype._write = function (chunk, encoding, cb) { - var self = this - if (!self._sourceBuffer) { - self._cb = function (err) { - if (err) return cb(err) - self._write(chunk, encoding, cb) - } - return - } - - if (self._sourceBuffer.updating) { - return cb(new Error('Cannot append buffer while source buffer updating')) - } - - self._sourceBuffer.appendBuffer(chunk) - debug('appendBuffer %s', chunk.length) - self._cb = cb -} - -MediaSourceStream.prototype._flow = function () { - var self = this - debug('flow') - if (self._cb) { - self._cb(null) - } -} - -function getType (extname) { - if (!extname) return null - if (extname[0] !== '.') extname = '.' + extname - return { - '.m4a': 'audio/mp4; codecs="mp4a.40.5"', - '.m4v': 'video/mp4; codecs="avc1.640029, mp4a.40.5"', - '.mp3': 'audio/mpeg', - '.mp4': 'video/mp4; codecs="avc1.640029, mp4a.40.5"', - '.webm': 'video/webm; codecs="vorbis, vp8"' - }[extname] -} diff --git a/package.json b/package.json index 75e445da..6c8701a8 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "inherits": "^2.0.1", "inquirer": "^0.9.0", "load-ip-set": "^1.0.3", + "mediasource": "^1.0.0", "memory-chunk-store": "^1.2.0", "mime": "^1.2.11", "minimist": "^1.1.0", From 158d9f35b9dbca98a7c5fb6226980113b84421c9 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 21:18:15 +0200 Subject: [PATCH 060/109] add explanatory comment --- lib/torrent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/torrent.js b/lib/torrent.js index 0319b128..0421cdbd 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -8,7 +8,7 @@ var debug = require('debug')('webtorrent:torrent') var Discovery = require('torrent-discovery') var EventEmitter = require('events').EventEmitter var extend = require('xtend/mutable') -var FSChunkStore = require('fs-chunk-store') +var FSChunkStore = require('fs-chunk-store') // browser: `memory-chunk-store` var ImmediateChunkStore = require('immediate-chunk-store') var inherits = require('inherits') var MultiStream = require('multistream') From 62624aaa0642ae58ff08ebaca681adb7c5b2a504 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 21:33:36 +0200 Subject: [PATCH 061/109] fix regression: progress should be capped at 100% --- lib/torrent.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index 0421cdbd..f78b9ea2 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -109,16 +109,6 @@ Object.defineProperty(Torrent.prototype, 'uploaded', { get: function () { return this.swarm ? this.swarm.uploaded : 0 } }) -// TODO: add this and use it for "progress" property -// Object.defineProperty(Torrent.prototype, 'verified', { -// get: function () { -// var self = this -// return self.pieces.reduce(function (total, piece) { -// return total + (piece.verified ? piece.length : piece.blocksWritten * BLOCK_LENGTH) -// }, 0) -// } -// }) - /** * The number of missing pieces. Used to implement 'end game' mode. */ @@ -135,7 +125,18 @@ Object.defineProperty(Torrent.prototype, 'uploaded', { // Percentage complete, represented as a number between 0 and 1 Object.defineProperty(Torrent.prototype, 'progress', { - get: function () { return this.length ? this.downloaded / this.length : 0 } + get: function () { + var complete = 0 + for (var index = 0, len = this.pieces.length; index < len; index++) { + if (this.bitfield.get(index)) { + complete += (index !== len - 1) ? this.pieceLength : this.lastPieceLength + } else { + var piece = this.pieces[index] + complete += (piece.length - piece.missing) + } + } + return this.length ? complete / this.length : 0 + } }) // Seed ratio From 97bdde4bd875c80e3ce75eb2bf00bf84055aaae4 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 21:34:58 +0200 Subject: [PATCH 062/109] 0.59.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c8701a8..7f5e8e8e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.58.0", + "version": "0.59.0", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From 1fb9c217372b5c03327ce0dcfc855d46ce5211c0 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 21:35:09 +0200 Subject: [PATCH 063/109] build --- webtorrent.min.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 5a18b469..93e71c0c 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,11 +1,11 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{"./media-stream":4,_process:49,debug:121,path:48,videostream:180}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],7:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:121,http:68,mime:131,pump:148,"range-parser":152,url:78}],8:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var O=5e3;var z=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r._path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){return this.swarm?this.swarm.downloaded:0}});Object.defineProperty(H.prototype,"uploaded",{get:function(){return this.swarm?this.swarm.uploaded:0}});Object.defineProperty(H.prototype,"progress",{get:function(){return this.length?this.downloaded/this.length:0}});Object.defineProperty(H.prototype,"ratio",{get:function(){return this.uploaded/(this.downloaded||1)}});Object.defineProperty(H.prototype,"numPeers",{get:function(){return this.swarm?this.swarm.numPeers:0}});Object.defineProperty(H.prototype,"torrentFileURL",{get:function(){if(typeof window==="undefined")throw new Error("browser-only property");if(!this.torrentFile)return null;return window.URL.createObjectURL(new window.Blob([this.torrentFile],{type:"application/x-bittorrent"}))}});H.prototype.downloadSpeed=function(){return this.swarm?this.swarm.downloadSpeed():0};H.prototype.uploadSpeed=function(){return this.swarm?this.swarm.uploadSpeed():0};H.prototype._onTorrentId=function(e){var t=this;if(t.destroyed)return;y.remote(e,function(e,r){if(t.destroyed)return;if(e)return t._onError(e);t._onParsedTorrent(r)})};H.prototype._onParsedTorrent=function(e){var t=this;if(t.destroyed)return;t._processParsedTorrent(e);if(!t.infoHash){return t._onError(new Error("Malformed torrent data: No info hash"))}if(!t._path)t._path=_.join(N,t.infoHash);t.swarm=new A(t.infoHash,t.client.peerId,{handshake:{dht:!!t.client.dht}});t.swarm.on("error",t._onError.bind(t));t.swarm.on("wire",t._onWire.bind(t));t.swarm.on("download",function(e){t.client.downloadSpeed(e);t.client.emit("download",e);t.emit("download",e)});t.swarm.on("upload",function(e){t.client.uploadSpeed(e);t.client.emit("upload",e);t.emit("upload",e)});t.swarm.listen(t.client.torrentPort,t._onSwarmListening.bind(t));r.nextTick(function(){if(t.destroyed)return;t.emit("infoHash",t.infoHash)})};H.prototype._processParsedTorrent=function(e){if(this.announce){e.announce=e.announce.concat(this.announce)}if(i.WEBTORRENT_ANNOUNCE){e.announce=e.announce.concat(i.WEBTORRENT_ANNOUNCE)}if(e.announce.length===0){e.announce=o.announceList.map(function(e){return e[0]})}if(this.urlList){e.urlList=e.urlList.concat(this.urlList)}U(e.announce);c(this,e);this.magnetURI=y.toMagnetURI(e);this.torrentFile=y.toTorrentFile(e)};H.prototype._onSwarmListening=function(){var e=this;if(e.destroyed)return;if(e.swarm.server)e.client.torrentPort=e.swarm.address().port;e.discovery=new u({announce:e.announce,dht:e.client.dht,tracker:e.client.tracker,peerId:e.client.peerId,port:e.client.torrentPort,rtcConfig:e.client._rtcConfig,wrtc:e.client._wrtc});e.discovery.on("error",e._onError.bind(e));e.discovery.setTorrent(e.infoHash);e.discovery.on("peer",e.addPeer.bind(e));S(e.discovery,e,["trackerAnnounce","dhtAnnounce","warning"]);if(e.info)e._onMetadata(e);e.emit("listening",e.client.torrentPort)};H.prototype._onMetadata=function(e){var t=this;if(t.metadata||t.destroyed)return;f("got metadata");var i;if(e&&e.infoHash){i=e}else{try{i=y(e)}catch(n){return t._onError(n)}}t._processParsedTorrent(i);t.metadata=t.torrentFile;t.discovery.setTorrent(t);if(t.urlList)t.urlList.forEach(t.addWebSeed.bind(t));t.rarityMap=new B(t.swarm,t.pieces.length);t.store=new d(new t._store(t.pieceLength,{files:t.files.map(function(e){return{path:_.join(t._path,e.path),length:e.length,offset:e.offset}}),length:t.length}));t.files=t.files.map(function(e){return new L(t,e)});t._hashes=t.pieces;t.pieces=t.pieces.map(function(e,r){var i=r===t.pieces.length-1?t.lastPieceLength:t.pieceLength;return new w(i)});t._reservations=t.pieces.map(function(){return[]});t.bitfield=new a(t.pieces.length);t.swarm.wires.forEach(function(e){if(e.ut_metadata)e.ut_metadata.setMetadata(t.metadata);t._onWireWithMetadata(e)});r.nextTick(function(){t.emit("metadata");t._onStore()})};H.prototype._onStore=function(){var e=this;if(e.destroyed)return;f("on store");e.select(0,e.pieces.length-1,false);e._rechokeIntervalId=setInterval(e._rechoke.bind(e),j);if(e._rechokeIntervalId.unref)e._rechokeIntervalId.unref();e.ready=true;e.emit("ready")};H.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;f("destroy");t.client.remove(t);if(t._rechokeIntervalId){clearInterval(t._rechokeIntervalId);t._rechokeIntervalId=null}var r=[];t._servers.forEach(function(e){r.push(function(t){e.destroy(t)})});if(t.swarm)r.push(function(e){t.swarm.destroy(e)});if(t.discovery)r.push(function(e){t.discovery.stop(e)});if(t.store)r.push(function(e){t.store.close(e)});g(r,e)};H.prototype.addPeer=function(e){var t=this;function r(){t.swarm.addPeer(e);t.emit("peer",e)}if(typeof e==="string"&&t.client.blocked&&t.client.blocked.contains(n(e)[0])){t.numBlockedPeers+=1;t.emit("blockedPeer",e);return false}else{if(t.swarm)r();else t.once("listening",r);return true}};H.prototype.addWebSeed=function(e){var t=this;t.swarm.addWebSeed(e,t)};H.prototype.select=function(e,t,r,i){var n=this;if(e>t||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,O);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,O);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>z)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=z)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._onPiece()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._onPiece=function(){var e=this;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r.bitfield.set(t,true)});r._onPiece();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C==="function"){var r=new C(t,e);t._servers.push(r);return r}};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":6,"./server":7,_process:49,"addr-to-ip-port":9,bitfield:10,"bittorrent-swarm":11,"chunk-store-stream/write":90,"create-torrent":91,debug:121,events:44,"fs-chunk-store":130,"immediate-chunk-store":128,inherits:129,multistream:133,os:47,"parse-torrent":134,path:48,"path-exists":147,pump:148,"random-iterate":151,"re-emitter":153,"run-parallel":154,"simple-sha1":163,"torrent-discovery":166,"torrent-piece":167,uniq:168,ut_metadata:169,ut_pex:39,"xtend/mutable":182}],9:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],10:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":12,"./lib/tcp-pool":13,_process:49,"addr-to-ip-port":39,buffer:40,debug:121,dezalgo:20,events:44,inherits:129,net:39,speedometer:165}],12:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":14,"bittorrent-protocol":15,debug:121}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":12,_process:49,debug:121,dezalgo:20,net:39}],14:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:10,"bittorrent-protocol":15,buffer:40,debug:121,inherits:129,"simple-get":159}],15:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:40,debug:121,"get-browser-rtc":32,hat:127,inherits:129,"is-typedarray":33,once:30,stream:67,"typedarray-to-buffer":34}],32:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],33:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],34:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:40,"is-typedarray":33}],35:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:40,debug:121,inherits:129,"is-typedarray":36,stream:67,"typedarray-to-buffer":37,ws:39}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],37:[function(e,t,r){arguments[4][34][0].apply(r,arguments)},{buffer:40,dup:34,"is-typedarray":36}],38:[function(e,t,r){},{}],39:[function(e,t,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],40:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){ -e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":41,ieee754:42,"is-array":43}],41:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],42:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],43:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],44:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],45:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:68}],46:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],47:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],48:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function O(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],52:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":69,_process:49,buffer:40,foreach:73,inherits:129,stream:67}],72:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],73:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],77:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:40}],78:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var O=this.hostname.split(".");var z=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:50,querystring:53}],79:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:40,defined:80,inherits:129,"readable-stream":89}],80:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:92,"block-stream2":96,buffer:40,dezalgo:107,"filestream/read":113,flatten:114,fs:38,"is-file":115,junk:116,multistream:133,once:118,path:48,"piece-length":119,"run-parallel":154,"simple-sha1":163,stream:67}],92:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./lib/decode":93,"./lib/encode":95,dup:16}],93:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./dict":94,buffer:40,dup:17}],94:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],95:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{buffer:40,dup:19}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{buffer:40,defined:97,dup:79,inherits:129,"readable-stream":106}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_readable":100,"./_stream_writable":102,_process:49,"core-util-is":103,dup:81,inherits:129}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_transform":101,"core-util-is":103,dup:82,inherits:129}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":98,_process:49,buffer:40,"core-util-is":103,dup:83,events:44,inherits:129,isarray:104,stream:67,"string_decoder/":105,util:39}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":98,"core-util-is":103,dup:84,inherits:129}],102:[function(e,t,r){arguments[4][85][0].apply(r,arguments)},{"./_stream_duplex":98,_process:49,buffer:40,"core-util-is":103,dup:85,inherits:129,stream:67}],103:[function(e,t,r){arguments[4][60][0].apply(r,arguments)},{buffer:40,dup:60}],104:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],105:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{buffer:40,dup:77}],106:[function(e,t,r){arguments[4][89][0].apply(r,arguments)},{"./lib/_stream_duplex.js":98,"./lib/_stream_passthrough.js":99,"./lib/_stream_readable.js":100,"./lib/_stream_transform.js":101,"./lib/_stream_writable.js":102,dup:89,stream:67}],107:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{asap:108,dup:20,wrappy:110}],108:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{"./raw":109,dup:21}],109:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],110:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23}],111:[function(e,t,r){arguments[4][34][0].apply(r,arguments)},{buffer:40,dup:34,"is-typedarray":112}],112:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{dup:33}],113:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:129,stream:67,"typedarray-to-buffer":111}],114:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],121:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":122}],122:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],128:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:49}],129:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],130:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:49}],131:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:40,"thirty-two":140,uniq:168,xtend:181}],140:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":141}],141:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:40}],142:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":124,fs:38,once:150}],149:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23}],150:[function(e,t,r){arguments[4][30][0].apply(r,arguments)},{dup:30,wrappy:149}],151:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],152:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],153:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:44}],154:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:155}],155:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{asap:156,dup:20,wrappy:158}],156:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{"./raw":157,dup:21}],157:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],158:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{dup:23}],159:[function(e,t,r){(function(r){t.exports=u;var i=e("http");var n=e("https");var a=e("once");var s=e("url");var o=e("unzip-response");var f=e("object-assign");function u(e,t){e=typeof e==="string"?{url:e}:f({},e);t=a(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var s=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!s)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?n:i;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:40,http:68,https:45,"object-assign":160,once:162,"unzip-response":39,url:78}],160:[function(e,t,r){"use strict";var i=Object.prototype.propertyIsEnumerable;function n(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return i.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var i;var s=n(e);for(var o=1;o>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:164}],164:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:170,bitfield:10,buffer:40,events:44,inherits:129,"simple-sha1":163}],170:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./lib/decode":171,"./lib/encode":173,dup:16}],171:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{"./dict":172,buffer:40,dup:17}],172:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],173:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{buffer:40,dup:19}],174:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],175:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":178}],177:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.58.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:48,debug:120,mediasource:129,path:47,videostream:180}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:120,http:67,mime:131,pump:148,"range-parser":152,url:77}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var O=5e3;var z=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r._path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){return this.swarm?this.swarm.downloaded:0}});Object.defineProperty(H.prototype,"uploaded",{get:function(){return this.swarm?this.swarm.uploaded:0}});Object.defineProperty(H.prototype,"progress",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,O);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,O);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>z)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=z)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._onPiece()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._onPiece=function(){var e=this;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r.bitfield.set(t,true)});r._onPiece();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C==="function"){var r=new C(t,e);t._servers.push(r);return r}};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:48,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":89,"create-torrent":90,debug:120,events:43,"fs-chunk-store":130,"immediate-chunk-store":127,inherits:128,multistream:133,os:46,"parse-torrent":134,path:47,"path-exists":147,pump:148,"random-iterate":151,"re-emitter":153,"run-parallel":154,"simple-sha1":163,"torrent-discovery":166,"torrent-piece":167,uniq:168,ut_metadata:169,ut_pex:38,"xtend/mutable":182}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:48,"addr-to-ip-port":38,buffer:39,debug:120,dezalgo:19,events:43,inherits:128,net:38,speedometer:165}],11:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":13,"bittorrent-protocol":14,debug:120}],12:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:48,debug:120,dezalgo:19,net:38}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:9,"bittorrent-protocol":14,buffer:39,debug:120,inherits:128,"simple-get":159}],14:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,"get-browser-rtc":31,hat:126,inherits:128,"is-typedarray":32,once:29,stream:66,"typedarray-to-buffer":33}],31:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],32:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],33:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:39,"is-typedarray":32}],34:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,inherits:128,"is-typedarray":35,stream:66,"typedarray-to-buffer":36,ws:38}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":35}],37:[function(e,t,r){},{}],38:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],39:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){ +this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":40,ieee754:41,"is-array":42}],40:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],41:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],42:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],43:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],44:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:67}],45:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],46:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],47:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function O(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],51:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":68,_process:48,buffer:39,foreach:72,inherits:128,stream:66}],71:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],72:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],76:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:39}],77:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var O=this.hostname.split(".");var z=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift(""); +}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:49,querystring:52}],78:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:39,defined:79,inherits:128,"readable-stream":88}],79:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:91,"block-stream2":95,buffer:39,dezalgo:106,"filestream/read":112,flatten:113,fs:37,"is-file":114,junk:115,multistream:133,once:117,path:47,"piece-length":118,"run-parallel":154,"simple-sha1":163,stream:66}],91:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":92,"./lib/encode":94,dup:15}],92:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":93,buffer:39,dup:16}],93:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],94:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],95:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{buffer:39,defined:96,dup:78,inherits:128,"readable-stream":105}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{dup:79}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{"./_stream_readable":99,"./_stream_writable":101,_process:48,"core-util-is":102,dup:80,inherits:128}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_transform":100,"core-util-is":102,dup:81,inherits:128}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:82,events:43,inherits:128,isarray:103,stream:66,"string_decoder/":104,util:38}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":97,"core-util-is":102,dup:83,inherits:128}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:84,inherits:128,stream:66}],102:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{buffer:39,dup:59}],103:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{dup:45}],104:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{buffer:39,dup:76}],105:[function(e,t,r){arguments[4][88][0].apply(r,arguments)},{"./lib/_stream_duplex.js":97,"./lib/_stream_passthrough.js":98,"./lib/_stream_readable.js":99,"./lib/_stream_transform.js":100,"./lib/_stream_writable.js":101,dup:88,stream:66}],106:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:107,dup:19,wrappy:109}],107:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":108,dup:20}],108:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],109:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],110:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":111}],111:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],112:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:128,stream:66,"typedarray-to-buffer":110}],113:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],120:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments); +}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":121}],121:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],127:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],128:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],129:[function(e,t,r){t.exports=s;var i=e("inherits");var n=e("stream");var a=typeof window!=="undefined"&&window.MediaSource;i(s,n.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);n.Writable.call(r,t);if(!a)throw new Error("web browser lacks MediaSource support");if(!t)t={};r._elem=e;r._mediaSource=new a;r._sourceBuffer=null;r._cb=null;r._type=t.type||o(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(a.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){r._mediaSource.endOfStream()})}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);i._cb=r};s.prototype._flow=function(){var e=this;if(e._cb){e._cb(null)}};function o(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{inherits:128,stream:66}],130:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],131:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":140,uniq:168,xtend:181}],140:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":141}],141:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],142:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":123,fs:37,once:150}],149:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],150:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:149}],151:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],152:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],153:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],154:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:155}],155:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:156,dup:19,wrappy:158}],156:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":157,dup:20}],157:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],158:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],159:[function(e,t,r){(function(r){t.exports=u;var i=e("http");var n=e("https");var a=e("once");var s=e("url");var o=e("unzip-response");var f=e("object-assign");function u(e,t){e=typeof e==="string"?{url:e}:f({},e);t=a(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var s=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!s)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?n:i;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:67,https:44,"object-assign":160,once:162,"unzip-response":38,url:77}],160:[function(e,t,r){"use strict";var i=Object.prototype.propertyIsEnumerable;function n(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return i.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var i;var s=n(e);for(var o=1;o>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:164}],164:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:170,bitfield:9,buffer:39,events:43,inherits:128,"simple-sha1":163}],170:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":171,"./lib/encode":173,dup:15}],171:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":172,buffer:39,dup:16}],172:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],173:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],174:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],175:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":178}],177:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:120,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.59.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Sun, 23 Aug 2015 23:01:33 +0200 Subject: [PATCH 064/109] eliminate extra nextTick for 'metadata' event --- lib/torrent.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index f78b9ea2..a9eb94d5 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -379,10 +379,9 @@ Torrent.prototype._onMetadata = function (metadata) { // }), self._onStore.bind(self)) // }) - process.nextTick(function () { - self.emit('metadata') - self._onStore() - }) + process.nextTick(function () { self._onStore() }) + + self.emit('metadata') } /** From e60e734db1322a1ca37d653935d7759caa96e14c Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 23:01:57 +0200 Subject: [PATCH 065/109] style --- lib/torrent.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index a9eb94d5..07db9857 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1173,11 +1173,10 @@ Torrent.prototype.load = function (streams, cb) { Torrent.prototype.createServer = function (opts) { var self = this - if (typeof Server === 'function' /* browser exclude */) { - var server = new Server(self, opts) - self._servers.push(server) - return server - } + if (typeof Server !== 'function') return // browser exclude + var server = new Server(self, opts) + self._servers.push(server) + return server } Torrent.prototype._onError = function (err) { From 52b35fac3cb9f838fa54f26ba7e8b9eb9f9fa6d0 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 23:39:34 +0200 Subject: [PATCH 066/109] add torrent.received; change torrent.downloaded The previous behavior of `torrent.downloaded` is now `torrent.received`. This is bytes received from peers (including invalid data). The new `torrent.downloaded` is what most people expected it to be all along. Bytes completed (excluding invalid data). --- lib/torrent.js | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index 07db9857..9562aa6d 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -99,8 +99,24 @@ Object.defineProperty(Torrent.prototype, 'timeRemaining', { } }) -// Bytes downloaded +// Bytes completed (excluding invalid data) Object.defineProperty(Torrent.prototype, 'downloaded', { + get: function () { + var downloaded = 0 + for (var index = 0, len = this.pieces.length; index < len; ++index) { + if (this.bitfield.get(index)) { // verified data + downloaded += (index === len - 1) ? this.lastPieceLength : this.pieceLength + } else { // "in progress" data + var piece = this.pieces[index] + downloaded += (piece.length - piece.missing) + } + } + return downloaded + } +}) + +// Bytes received from peers (including invalid data) +Object.defineProperty(Torrent.prototype, 'received', { get: function () { return this.swarm ? this.swarm.downloaded : 0 } }) @@ -125,18 +141,7 @@ Object.defineProperty(Torrent.prototype, 'uploaded', { // Percentage complete, represented as a number between 0 and 1 Object.defineProperty(Torrent.prototype, 'progress', { - get: function () { - var complete = 0 - for (var index = 0, len = this.pieces.length; index < len; index++) { - if (this.bitfield.get(index)) { - complete += (index !== len - 1) ? this.pieceLength : this.lastPieceLength - } else { - var piece = this.pieces[index] - complete += (piece.length - piece.missing) - } - } - return this.length ? complete / this.length : 0 - } + get: function () { return this.length ? this.downloaded / this.length : 0 } }) // Seed ratio From 9e067979fcadd0915755246c79f54e7d1abf2152 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 23:39:55 +0200 Subject: [PATCH 067/109] torrent.load should cancel reservations --- lib/torrent.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/torrent.js b/lib/torrent.js index 9562aa6d..65950430 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1108,8 +1108,8 @@ Torrent.prototype._request = function (wire, index, hotswap) { self.pieces[index] = null self._reservations[index] = null - self.bitfield.set(index, true) + self.store.put(index, buf) self.swarm.wires.forEach(function (wire) { @@ -1169,6 +1169,7 @@ Torrent.prototype.load = function (streams, cb) { if (err) return cb(err) self.pieces.forEach(function (piece, index) { self.pieces[index] = null + self._reservations[index] = null self.bitfield.set(index, true) }) self._onPiece() From c600f62d5b6813b34d3068ad9f7ed948433dfa60 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 23:40:24 +0200 Subject: [PATCH 068/109] cmd: use new `torrent.downloaded` property --- bin/cmd.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index 19fbab13..55364250 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -523,9 +523,9 @@ function drawTorrent (torrent) { } clivas.line( '{green:speed: }{bold:' + prettyBytes(speed) + '/s} ' + - '{green:downloaded:} {bold:' + prettyBytes(torrent.swarm.downloaded) + '}' + + '{green:downloaded:} {bold:' + prettyBytes(torrent.downloaded) + '}' + '/{bold:' + prettyBytes(torrent.length) + '} ' + - '{green:uploaded:} {bold:' + prettyBytes(torrent.swarm.uploaded) + '} ' + + '{green:uploaded:} {bold:' + prettyBytes(torrent.uploaded) + '} ' + '{green:peers:} {bold:' + unchoked.length + '/' + torrent.swarm.wires.length + '} ' + '{green:hotswaps:} {bold:' + hotswaps + '}' ) From 7b26b84d92810f86f7524cc6b8dc25b0ba40b0c7 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 23 Aug 2015 23:41:34 +0200 Subject: [PATCH 069/109] cmd: remove verbose block data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a lot harder to visualize with the new torrent-piece backend, since we don’t keep an explicit array of which blocks are reserved. Just remove it for now. If we need this visualization back to debug something, it should be possible to recreate it from torrent-piece with a bit of work. --- bin/cmd.js | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index 55364250..816d94ec 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -538,32 +538,6 @@ function drawTorrent (torrent) { clivas.line('{80:}') linesRemaining -= 5 - if (argv.verbose) { - var pieces = torrent.pieces - for (var i = 0; i < pieces.length; i++) { - var piece = pieces[i] - if (piece.verified || (piece.blocksWritten === 0 && !piece.blocks[0])) continue - var bar = '' - for (var j = 0; j < piece.blocks.length; j++) { - // switch (piece.blocks[j]) { - // case Storage.BLOCK_BLANK: - // bar += '{red:█}' - // break - // case Storage.BLOCK_RESERVED: - // bar += '{blue:█}' - // break - // case Storage.BLOCK_WRITTEN: - // bar += '{green:█}' - // break - // } - } - clivas.line('{4+cyan:' + i + '} ' + bar) - linesRemaining -= 1 - } - clivas.line('{80:}') - linesRemaining -= 1 - } - torrent.swarm.wires.every(function (wire) { var progress = '?' if (torrent.length) { From 3d7d78c12e186ea58e6a7a2064303f3681ede861 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 24 Aug 2015 00:25:13 +0200 Subject: [PATCH 070/109] verify existing torrent data --- lib/torrent.js | 64 +++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index 65950430..c3a9cf42 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -354,37 +354,30 @@ Torrent.prototype._onMetadata = function (metadata) { self._onWireWithMetadata(wire) }) - // VERIFY TORRENT DATA - // TODO: remove nextTick - // process.nextTick(function () { - // debug('verifying existing torrent data') - // var numPieces = 0 - // var numVerified = 0 - - // // TODO: move storage verification to storage.js? - // parallel(self.storage.pieces.map(function (piece) { - // return function (cb) { - // self.storage.read(piece.index, function (err, buffer) { - // numPieces += 1 - // self.emit('verifying', { - // percentDone: 100 * numPieces / self.storage.pieces.length, - // percentVerified: 100 * numVerified / self.storage.pieces.length - // }) - - // if (!err && buffer) { - // // TODO: this is a bit hacky; figure out a cleaner way of verifying the buffer - // piece.verify(buffer) - // numVerified += piece.verified - // debug('piece ' + (piece.verified ? 'verified' : 'invalid') + ' ' + piece.index) - // } - // // continue regardless of whether piece verification failed - // cb() - // }, true) // forces override to allow reading from non-verified pieces - // } - // }), self._onStore.bind(self)) - // }) - - process.nextTick(function () { self._onStore() }) + debug('verifying existing torrent data') + parallel(self.pieces.map(function (piece, index) { + return function (cb) { + self.store.get(index, function (err, buf) { + if (err) return cb(null) // ignore error + sha1(buf, function (hash) { + if (hash === self._hashes[index]) { + if (!self.pieces[index]) return + debug('piece verified %s', index) + self.pieces[index] = null + self._reservations[index] = null + self.bitfield.set(index, true) + } else { + debug('piece invalid %s', index) + } + cb(null) + }) + }) + } + }), function (err) { + if (err) return self._onError(err) + debug('done verifying') + self._onStore() + }) self.emit('metadata') } @@ -405,6 +398,8 @@ Torrent.prototype._onStore = function () { self.ready = true self.emit('ready') + + self._checkDone() } /** @@ -1116,7 +1111,7 @@ Torrent.prototype._request = function (wire, index, hotswap) { wire.have(index) }) - self._onPiece() + self._checkDone() } else { self.pieces[index] = new Piece(piece.length) self.emit('warning', new Error('Piece ' + index + ' failed verification')) @@ -1132,8 +1127,9 @@ Torrent.prototype._request = function (wire, index, hotswap) { return true } -Torrent.prototype._onPiece = function () { +Torrent.prototype._checkDone = function () { var self = this + if (self.destroyed) return // are any new files done? self.files.forEach(function (file) { @@ -1172,7 +1168,7 @@ Torrent.prototype.load = function (streams, cb) { self._reservations[index] = null self.bitfield.set(index, true) }) - self._onPiece() + self._checkDone() cb(null) }) } From 306cc84c4a3a7dc6509760ec6c9b922d4cd9788a Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 24 Aug 2015 00:25:38 +0200 Subject: [PATCH 071/109] improve tests to pass when verifying torrent data --- test/blocklist-dht.js | 28 ++++++++++++++++++++-------- test/blocklist-tracker.js | 2 +- test/download-dht-magnet.js | 14 ++++++++------ test/download-dht-torrent.js | 14 +++++++------- test/download-tracker-magnet.js | 13 +++++++++++-- test/download-tracker-torrent.js | 14 ++++++++++++-- test/download-webseed-magnet.js | 11 ++++++++++- test/download-webseed-torrent.js | 11 ++++++++++- 8 files changed, 79 insertions(+), 28 deletions(-) diff --git a/test/blocklist-dht.js b/test/blocklist-dht.js index 3e8710b3..6d4c1c9e 100644 --- a/test/blocklist-dht.js +++ b/test/blocklist-dht.js @@ -13,7 +13,7 @@ var leavesParsed = parseTorrent(leavesTorrent) leavesParsed.announce = [] test('blocklist blocks peers discovered via DHT', function (t) { - t.plan(7) + t.plan(8) var dhtServer = new DHT({ bootstrap: false }) @@ -38,13 +38,6 @@ test('blocklist blocks peers discovered via DHT', function (t) { var torrent1 = client1.add(leavesParsed) - client1.on('torrent', function () { - torrent1.on('dhtAnnounce', function () { - t.pass('client1 announced to dht') - cb(null, client1) - }) - }) - torrent1.on('peer', function () { t.fail('client1 should not find any peers') }) @@ -52,6 +45,25 @@ test('blocklist blocks peers discovered via DHT', function (t) { torrent1.on('blockedPeer', function () { t.fail('client1 should not block any peers') }) + + torrent1.on('ready', function () { + t.pass('torrent1 ready') + torrentReady = true + maybeDone() + }) + + torrent1.on('dhtAnnounce', function () { + t.pass('client1 announced to dht') + announced = true + maybeDone() + }) + + var torrentReady = false + var announced = false + function maybeDone () { + if (torrentReady && announced) cb(null, client1) + } + }], client2: ['client1', function (cb, r) { diff --git a/test/blocklist-tracker.js b/test/blocklist-tracker.js index e34b16ac..cac256e8 100644 --- a/test/blocklist-tracker.js +++ b/test/blocklist-tracker.js @@ -13,7 +13,7 @@ test('blocklist blocks peers discovered via tracker', function (t) { auto({ tracker: function (cb) { - var tracker = new TrackerServer({ udp: false }) + var tracker = new TrackerServer({ udp: false, ws: false }) tracker.listen(function () { var port = tracker.http.address().port diff --git a/test/download-dht-magnet.js b/test/download-dht-magnet.js index b1c6a7ad..34656e20 100644 --- a/test/download-dht-magnet.js +++ b/test/download-dht-magnet.js @@ -43,18 +43,20 @@ test('Download using DHT (via magnet uri)', function (t) { if (announced && loaded) cb(null, client1) } - client1.add(leavesParsed, function (torrent) { + var torrent = client1.add(leavesParsed) + + torrent.on('dhtAnnounce', function () { + announced = true + maybeDone() + }) + + torrent.on('ready', function () { // torrent metadata has been fetched -- sanity check it t.equal(torrent.name, 'Leaves of Grass by Walt Whitman.epub') var names = [ 'Leaves of Grass by Walt Whitman.epub' ] t.deepEqual(torrent.files.map(function (file) { return file.name }), names) - torrent.on('dhtAnnounce', function () { - announced = true - maybeDone() - }) - torrent.load(fs.createReadStream(leavesPath), function (err) { t.error(err) loaded = true diff --git a/test/download-dht-torrent.js b/test/download-dht-torrent.js index bc51a71c..408b0606 100644 --- a/test/download-dht-torrent.js +++ b/test/download-dht-torrent.js @@ -36,7 +36,7 @@ test('Download using DHT (via .torrent file)', function (t) { client1.on('error', function (err) { t.fail(err) }) client1.on('warning', function (err) { t.fail(err) }) - client1.add(leavesParsed) + var torrent = client1.add(leavesParsed) var announced = false var loaded = false @@ -44,23 +44,23 @@ test('Download using DHT (via .torrent file)', function (t) { if ((announced && loaded) || err) cb(err, client1) } - client1.on('torrent', function (torrent) { + torrent.on('ready', function () { // torrent metadata has been fetched -- sanity check it t.equal(torrent.name, 'Leaves of Grass by Walt Whitman.epub') var names = [ 'Leaves of Grass by Walt Whitman.epub' ] t.deepEqual(torrent.files.map(function (file) { return file.name }), names) - torrent.on('dhtAnnounce', function () { - announced = true - maybeDone(null) - }) - torrent.load(fs.createReadStream(leavesPath), function (err) { loaded = true maybeDone(err) }) }) + + torrent.on('dhtAnnounce', function () { + announced = true + maybeDone(null) + }) }], client2: ['client1', function (cb, r) { diff --git a/test/download-tracker-magnet.js b/test/download-tracker-magnet.js index 43ed3931..0aac1fb8 100644 --- a/test/download-tracker-magnet.js +++ b/test/download-tracker-magnet.js @@ -27,7 +27,7 @@ function magnetDownloadTest (t, serverType) { auto({ tracker: function (cb) { var tracker = new TrackerServer( - serverType === 'udp' ? { http: false } : { udp: false } + serverType === 'udp' ? { http: false, ws: false } : { udp: false, ws: false } ) tracker.on('error', function (err) { t.fail(err) }) @@ -84,13 +84,22 @@ function magnetDownloadTest (t, serverType) { file.getBuffer(function (err, buf) { if (err) throw err t.deepEqual(buf, leavesFile, 'downloaded correct content') + gotBuffer = true + maybeDone() }) }) torrent.once('done', function () { t.pass('client2 downloaded torrent from client1') - cb(null, client2) + torrentDone = true + maybeDone() }) + + var gotBuffer = false + var torrentDone = false + function maybeDone () { + if (gotBuffer && torrentDone) cb(null, client2) + } }) }] diff --git a/test/download-tracker-torrent.js b/test/download-tracker-torrent.js index c724f0a8..1fbe54fb 100644 --- a/test/download-tracker-torrent.js +++ b/test/download-tracker-torrent.js @@ -26,7 +26,7 @@ function torrentDownloadTest (t, serverType) { auto({ tracker: function (cb) { var tracker = new TrackerServer( - serverType === 'udp' ? { http: false } : { udp: false } + serverType === 'udp' ? { http: false, ws: false } : { udp: false, ws: false } ) tracker.on('error', function (err) { t.fail(err) }) @@ -84,14 +84,24 @@ function torrentDownloadTest (t, serverType) { file.getBuffer(function (err, buf) { if (err) throw err t.deepEqual(buf, leavesFile, 'downloaded correct content') + gotBuffer = true + maybeDone() }) }) torrent.once('done', function () { t.pass('client2 downloaded torrent from client1') - cb(null, client2) + torrentDone = true + maybeDone() }) + + var gotBuffer = false + var torrentDone = false + function maybeDone () { + if (gotBuffer && torrentDone) cb(null, client2) + } }) + }] }, function (err, r) { diff --git a/test/download-webseed-magnet.js b/test/download-webseed-magnet.js index 214a92b2..97ec256f 100644 --- a/test/download-webseed-magnet.js +++ b/test/download-webseed-magnet.js @@ -81,13 +81,22 @@ test('Download using webseed (via magnet uri)', function (t) { file.getBuffer(function (err, buf) { t.error(err) t.deepEqual(buf, leavesFile, 'downloaded correct content') + gotBuffer = true + maybeDone() }) }) torrent.once('done', function () { t.pass('client2 downloaded torrent from client1') - cb(null, client2) + torrentDone = true + maybeDone() }) + + var gotBuffer = false + var torrentDone = false + function maybeDone () { + if (gotBuffer && torrentDone) cb(null, client2) + } }) client2.add(magnetUri) diff --git a/test/download-webseed-torrent.js b/test/download-webseed-torrent.js index 4e5d2792..e9f8bd14 100644 --- a/test/download-webseed-torrent.js +++ b/test/download-webseed-torrent.js @@ -48,13 +48,22 @@ test('Download using webseed (via .torrent file)', function (t) { file.getBuffer(function (err, buf) { t.error(err) t.deepEqual(buf, leavesFile, 'downloaded correct content') + gotBuffer = true + maybeDone() }) }) torrent.once('done', function () { t.pass('client downloaded torrent from webseed') - cb(null, client) + torrentDone = true + maybeDone() }) + + var gotBuffer = false + var torrentDone = false + function maybeDone () { + if (gotBuffer && torrentDone) cb(null, client) + } }) client.add(leavesParsed) From 435d4eb5ece8be77160224823d6562fc5760c89d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 24 Aug 2015 00:28:50 +0200 Subject: [PATCH 072/109] 0.60.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f5e8e8e..6cadf236 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.59.0", + "version": "0.60.0", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From 77538eb1e31417a4e2a5a89b2147a8a10c33958d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 24 Aug 2015 00:29:19 +0200 Subject: [PATCH 073/109] build --- webtorrent.min.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 93e71c0c..67d03e9b 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,11 +1,12 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:48,debug:120,mediasource:129,path:47,videostream:180}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:120,http:67,mime:131,pump:148,"range-parser":152,url:77}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var O=5e3;var z=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r._path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){return this.swarm?this.swarm.downloaded:0}});Object.defineProperty(H.prototype,"uploaded",{get:function(){return this.swarm?this.swarm.uploaded:0}});Object.defineProperty(H.prototype,"progress",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,O);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,O);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>z)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=z)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._onPiece()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._onPiece=function(){var e=this;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r.bitfield.set(t,true)});r._onPiece();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C==="function"){var r=new C(t,e);t._servers.push(r);return r}};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:48,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":89,"create-torrent":90,debug:120,events:43,"fs-chunk-store":130,"immediate-chunk-store":127,inherits:128,multistream:133,os:46,"parse-torrent":134,path:47,"path-exists":147,pump:148,"random-iterate":151,"re-emitter":153,"run-parallel":154,"simple-sha1":163,"torrent-discovery":166,"torrent-piece":167,uniq:168,ut_metadata:169,ut_pex:38,"xtend/mutable":182}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:48,"addr-to-ip-port":38,buffer:39,debug:120,dezalgo:19,events:43,inherits:128,net:38,speedometer:165}],11:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":13,"bittorrent-protocol":14,debug:120}],12:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:48,debug:120,dezalgo:19,net:38}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:9,"bittorrent-protocol":14,buffer:39,debug:120,inherits:128,"simple-get":159}],14:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,"get-browser-rtc":31,hat:126,inherits:128,"is-typedarray":32,once:29,stream:66,"typedarray-to-buffer":33}],31:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],32:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],33:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:39,"is-typedarray":32}],34:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,inherits:128,"is-typedarray":35,stream:66,"typedarray-to-buffer":36,ws:38}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":35}],37:[function(e,t,r){},{}],38:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],39:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){ -this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":40,ieee754:41,"is-array":42}],40:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],41:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],42:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],43:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],44:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:67}],45:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],46:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],47:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function O(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],51:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":68,_process:48,buffer:39,foreach:72,inherits:128,stream:66}],71:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],72:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],76:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:39}],77:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var O=this.hostname.split(".");var z=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift(""); -}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:49,querystring:52}],78:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:39,defined:79,inherits:128,"readable-stream":88}],79:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:91,"block-stream2":95,buffer:39,dezalgo:106,"filestream/read":112,flatten:113,fs:37,"is-file":114,junk:115,multistream:133,once:117,path:47,"piece-length":118,"run-parallel":154,"simple-sha1":163,stream:66}],91:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":92,"./lib/encode":94,dup:15}],92:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":93,buffer:39,dup:16}],93:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],94:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],95:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{buffer:39,defined:96,dup:78,inherits:128,"readable-stream":105}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{dup:79}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{"./_stream_readable":99,"./_stream_writable":101,_process:48,"core-util-is":102,dup:80,inherits:128}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_transform":100,"core-util-is":102,dup:81,inherits:128}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:82,events:43,inherits:128,isarray:103,stream:66,"string_decoder/":104,util:38}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":97,"core-util-is":102,dup:83,inherits:128}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:84,inherits:128,stream:66}],102:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{buffer:39,dup:59}],103:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{dup:45}],104:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{buffer:39,dup:76}],105:[function(e,t,r){arguments[4][88][0].apply(r,arguments)},{"./lib/_stream_duplex.js":97,"./lib/_stream_passthrough.js":98,"./lib/_stream_readable.js":99,"./lib/_stream_transform.js":100,"./lib/_stream_writable.js":101,dup:88,stream:66}],106:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:107,dup:19,wrappy:109}],107:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":108,dup:20}],108:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],109:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],110:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":111}],111:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],112:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:128,stream:66,"typedarray-to-buffer":110}],113:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],120:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments); -}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":121}],121:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],127:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],128:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],129:[function(e,t,r){t.exports=s;var i=e("inherits");var n=e("stream");var a=typeof window!=="undefined"&&window.MediaSource;i(s,n.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);n.Writable.call(r,t);if(!a)throw new Error("web browser lacks MediaSource support");if(!t)t={};r._elem=e;r._mediaSource=new a;r._sourceBuffer=null;r._cb=null;r._type=t.type||o(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(a.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){r._mediaSource.endOfStream()})}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);i._cb=r};s.prototype._flow=function(){var e=this;if(e._cb){e._cb(null)}};function o(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{inherits:128,stream:66}],130:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],131:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":140,uniq:168,xtend:181}],140:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":141}],141:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],142:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":123,fs:37,once:150}],149:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],150:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:149}],151:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],152:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],153:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],154:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:155}],155:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:156,dup:19,wrappy:158}],156:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":157,dup:20}],157:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],158:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],159:[function(e,t,r){(function(r){t.exports=u;var i=e("http");var n=e("https");var a=e("once");var s=e("url");var o=e("unzip-response");var f=e("object-assign");function u(e,t){e=typeof e==="string"?{url:e}:f({},e);t=a(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var s=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!s)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?n:i;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=s.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:67,https:44,"object-assign":160,once:162,"unzip-response":38,url:77}],160:[function(e,t,r){"use strict";var i=Object.prototype.propertyIsEnumerable;function n(e){if(e==null){throw new TypeError("Object.assign cannot be called with null or undefined")}return Object(e)}function a(e){var t=Object.getOwnPropertyNames(e);if(Object.getOwnPropertySymbols){t=t.concat(Object.getOwnPropertySymbols(e))}return t.filter(function(t){return i.call(e,t)})}t.exports=Object.assign||function(e,t){var r;var i;var s=n(e);for(var o=1;o>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:164}],164:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:170,bitfield:9,buffer:39,events:43,inherits:128,"simple-sha1":163}],170:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":171,"./lib/encode":173,dup:15}],171:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":172,buffer:39,dup:16}],172:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],173:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],174:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],175:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":178}],177:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:120,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.59.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n=31}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":7}],7:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],10:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],11:[function(e,t,r){t.exports=i;function i(e,t){if(e&&t)return i(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){r[t]=e[t]});return r;function r(){var t=new Array(arguments.length);for(var r=0;ro){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:51,debug:6,"get-browser-rtc":19,hat:9,inherits:10,"is-typedarray":20,once:12,stream:78,"typedarray-to-buffer":21}],19:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],20:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],21:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:51,"is-typedarray":20}],22:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect"); +n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:51,debug:6,inherits:10,"is-typedarray":23,stream:78,"typedarray-to-buffer":24,ws:50}],23:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{dup:20}],24:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{buffer:51,dup:21,"is-typedarray":23}],25:[function(e,t,r){"use strict";function i(e,t){var r=1,i=e.length,n=e[0],a=e[0];for(var s=1;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:60,debug:132,mediasource:141,path:59,videostream:191}],28:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],32:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:132,http:79,mime:143,pump:160,"range-parser":164,url:89}],33:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r._path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":29,"./rarity-map":31,"./server":32,_process:60,"addr-to-ip-port":34,bitfield:35,"bittorrent-swarm":36,"chunk-store-stream/write":101,"create-torrent":102,debug:132,events:55,"fs-chunk-store":142,"immediate-chunk-store":139,inherits:140,multistream:145,os:58,"parse-torrent":146,path:59,"path-exists":159,pump:160,"random-iterate":163,"re-emitter":165,"run-parallel":166,"simple-sha1":174,"torrent-discovery":177,"torrent-piece":178,uniq:179,ut_metadata:180,ut_pex:50,"xtend/mutable":193}],34:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],35:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":37,"./lib/tcp-pool":38,_process:60,"addr-to-ip-port":50,buffer:51,debug:132,dezalgo:45,events:55,inherits:140,net:50,speedometer:176}],37:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":39,"bittorrent-protocol":40,debug:132}],38:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":37,_process:60,debug:132,dezalgo:45,net:50}],39:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:35,"bittorrent-protocol":40,buffer:51,debug:132,inherits:140,"simple-get":171}],40:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;n1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e); +}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":52,ieee754:53,"is-array":54}],52:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],53:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],54:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],55:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],56:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:79}],57:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],58:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],59:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function z(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],63:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended); +if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":80,_process:60,buffer:51,foreach:84,inherits:140,stream:78}],83:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],84:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],88:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n); +}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:51}],89:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:61,querystring:64}],90:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:51,defined:91,inherits:140,"readable-stream":100}],91:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t); +f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:103,"block-stream2":107,buffer:51,dezalgo:118,"filestream/read":124,flatten:125,fs:49,"is-file":126,junk:127,multistream:145,once:129,path:59,"piece-length":130,"run-parallel":166,"simple-sha1":174,stream:78}],103:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./lib/decode":104,"./lib/encode":106,dup:41}],104:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{"./dict":105,buffer:51,dup:42}],105:[function(e,t,r){arguments[4][43][0].apply(r,arguments)},{dup:43}],106:[function(e,t,r){arguments[4][44][0].apply(r,arguments)},{buffer:51,dup:44}],107:[function(e,t,r){arguments[4][90][0].apply(r,arguments)},{buffer:51,defined:108,dup:90,inherits:140,"readable-stream":117}],108:[function(e,t,r){arguments[4][91][0].apply(r,arguments)},{dup:91}],109:[function(e,t,r){arguments[4][92][0].apply(r,arguments)},{"./_stream_readable":111,"./_stream_writable":113,_process:60,"core-util-is":114,dup:92,inherits:140}],110:[function(e,t,r){arguments[4][93][0].apply(r,arguments)},{"./_stream_transform":112,"core-util-is":114,dup:93,inherits:140}],111:[function(e,t,r){arguments[4][94][0].apply(r,arguments)},{"./_stream_duplex":109,_process:60,buffer:51,"core-util-is":114,dup:94,events:55,inherits:140,isarray:115,stream:78,"string_decoder/":116,util:50}],112:[function(e,t,r){arguments[4][95][0].apply(r,arguments)},{"./_stream_duplex":109,"core-util-is":114,dup:95,inherits:140}],113:[function(e,t,r){arguments[4][96][0].apply(r,arguments)},{"./_stream_duplex":109,_process:60,buffer:51,"core-util-is":114,dup:96,inherits:140,stream:78}],114:[function(e,t,r){arguments[4][71][0].apply(r,arguments)},{buffer:51,dup:71}],115:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],116:[function(e,t,r){arguments[4][88][0].apply(r,arguments)},{buffer:51,dup:88}],117:[function(e,t,r){arguments[4][100][0].apply(r,arguments)},{"./lib/_stream_duplex.js":109,"./lib/_stream_passthrough.js":110,"./lib/_stream_readable.js":111,"./lib/_stream_transform.js":112,"./lib/_stream_writable.js":113,dup:100,stream:78}],118:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{asap:119,dup:14,wrappy:121}],119:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./raw":120,dup:15}],120:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{dup:16}],121:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],122:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{buffer:51,dup:21,"is-typedarray":123}],123:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{dup:20}],124:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:140,stream:78,"typedarray-to-buffer":122}],125:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],132:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{"./debug":133,dup:6}],133:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{dup:7,ms:134}],134:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{dup:8}],135:[function(e,t,r){var i=e("once");var n=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=i(r||n);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:137}],136:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],137:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12,wrappy:136}],138:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9}],139:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:60}],140:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],141:[function(e,t,r){t.exports=s;var i=e("inherits");var n=e("stream");var a=typeof window!=="undefined"&&window.MediaSource;i(s,n.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);n.Writable.call(r,t);if(!a)throw new Error("web browser lacks MediaSource support");if(!t)t={};r._elem=e;r._mediaSource=new a;r._sourceBuffer=null;r._cb=null;r._type=t.type||o(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(a.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){r._mediaSource.endOfStream()})}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);i._cb=r};s.prototype._flow=function(){var e=this;if(e._cb){e._cb(null)}};function o(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{inherits:140,stream:78}],142:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:60}],143:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:51,"thirty-two":152,uniq:179,xtend:192}],152:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":153}],153:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:51}],154:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":135,fs:49,once:162}],161:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],162:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12,wrappy:161}],163:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],164:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],165:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:55}],166:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dezalgo:167,dup:13}],167:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{asap:168,dup:14,wrappy:170}],168:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./raw":169,dup:15}],169:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{dup:16}],170:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],171:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:51,http:79,https:56,once:173,"unzip-response":50,url:89,xtend:192}],172:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],173:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12,wrappy:172}],174:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:175}],175:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],176:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:181,bitfield:35,buffer:51,events:55,inherits:140,"simple-sha1":174}],181:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./lib/decode":182,"./lib/encode":184,dup:41}],182:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{"./dict":183,buffer:51,dup:42}],183:[function(e,t,r){arguments[4][43][0].apply(r,arguments)},{dup:43}],184:[function(e,t,r){arguments[4][44][0].apply(r,arguments)},{buffer:51,dup:44}],185:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],186:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":189}],188:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r; +r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],190:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:132,mp4box:190}],192:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],195:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.60.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],196:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Tue, 25 Aug 2015 04:48:28 +0000 Subject: [PATCH 074/109] Add torrent.path --- lib/torrent.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/torrent.js b/lib/torrent.js index c3a9cf42..c7c75211 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -99,6 +99,11 @@ Object.defineProperty(Torrent.prototype, 'timeRemaining', { } }) +// Torrent Path +Object.defineProperty(Torrent.prototype, 'path', { + get: function () { return this._path; } +}) + // Bytes completed (excluding invalid data) Object.defineProperty(Torrent.prototype, 'downloaded', { get: function () { From 1915ec15755328905e608975471e6266384f6d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Stein?= Date: Tue, 25 Aug 2015 04:49:58 +0000 Subject: [PATCH 075/109] Add torrent.path to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 10053f5a..48bdf3b6 100644 --- a/README.md +++ b/README.md @@ -333,6 +333,10 @@ the file has. The attached [bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance. +#### `torrent.path` + +GEt the torrent download location + #### `torrent.destroy()` Alias for `client.remove(torrent)`. From a1bbb572e32c974b0b6724d5a651ed8f7865dbcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Stein?= Date: Tue, 25 Aug 2015 04:52:12 +0000 Subject: [PATCH 076/109] Add torrent.downloaded and torrent.received to README --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 48bdf3b6..8df1429c 100644 --- a/README.md +++ b/README.md @@ -333,9 +333,17 @@ the file has. The attached [bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance. +#### `torrent.received` + +Get total bytes received from peers (including invalid data) + +#### `torrent.downloaded` + +Get total bytes received from peers (excluding invalid data) + #### `torrent.path` -GEt the torrent download location +Get the torrent download location #### `torrent.destroy()` From 13a67e4f522652e437da14195bcbed1fdda1e61b Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 28 Aug 2015 20:46:41 +0200 Subject: [PATCH 077/109] expose torrent.path in a clean way (fix #409) --- lib/torrent.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index c7c75211..9d4ecdf5 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -61,7 +61,7 @@ function Torrent (torrentId, opts) { self.announce = opts.announce self.urlList = opts.urlList - self._path = opts.path + self.path = opts.path self._store = opts.store || FSChunkStore self.strategy = opts.strategy || 'sequential' @@ -99,11 +99,6 @@ Object.defineProperty(Torrent.prototype, 'timeRemaining', { } }) -// Torrent Path -Object.defineProperty(Torrent.prototype, 'path', { - get: function () { return this._path; } -}) - // Bytes completed (excluding invalid data) Object.defineProperty(Torrent.prototype, 'downloaded', { get: function () { @@ -197,7 +192,7 @@ Torrent.prototype._onParsedTorrent = function (parsedTorrent) { return self._onError(new Error('Malformed torrent data: No info hash')) } - if (!self._path) self._path = path.join(TMP, self.infoHash) + if (!self.path) self.path = path.join(TMP, self.infoHash) // create swarm self.swarm = new Swarm(self.infoHash, self.client.peerId, { @@ -323,7 +318,7 @@ Torrent.prototype._onMetadata = function (metadata) { new self._store(self.pieceLength, { files: self.files.map(function (file) { return { - path: path.join(self._path, file.path), + path: path.join(self.path, file.path), length: file.length, offset: file.offset } From 1b0286018f7e50b68259ec63043c97229bd5f138 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 28 Aug 2015 20:55:40 +0200 Subject: [PATCH 078/109] 0.60.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6cadf236..18e06837 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.60.0", + "version": "0.60.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From 934da5a2b6af597450d31fd66e851b1cd7b914e8 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 28 Aug 2015 20:55:52 +0200 Subject: [PATCH 079/109] build --- webtorrent.min.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 67d03e9b..fae8f762 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,12 +1,11 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=31}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":7}],7:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],10:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],11:[function(e,t,r){t.exports=i;function i(e,t){if(e&&t)return i(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){r[t]=e[t]});return r;function r(){var t=new Array(arguments.length);for(var r=0;ro){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:51,debug:6,"get-browser-rtc":19,hat:9,inherits:10,"is-typedarray":20,once:12,stream:78,"typedarray-to-buffer":21}],19:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],20:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],21:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:51,"is-typedarray":20}],22:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect"); -n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:51,debug:6,inherits:10,"is-typedarray":23,stream:78,"typedarray-to-buffer":24,ws:50}],23:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{dup:20}],24:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{buffer:51,dup:21,"is-typedarray":23}],25:[function(e,t,r){"use strict";function i(e,t){var r=1,i=e.length,n=e[0],a=e[0];for(var s=1;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:60,debug:132,mediasource:141,path:59,videostream:191}],28:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],32:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:132,http:79,mime:143,pump:160,"range-parser":164,url:89}],33:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r._path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":29,"./rarity-map":31,"./server":32,_process:60,"addr-to-ip-port":34,bitfield:35,"bittorrent-swarm":36,"chunk-store-stream/write":101,"create-torrent":102,debug:132,events:55,"fs-chunk-store":142,"immediate-chunk-store":139,inherits:140,multistream:145,os:58,"parse-torrent":146,path:59,"path-exists":159,pump:160,"random-iterate":163,"re-emitter":165,"run-parallel":166,"simple-sha1":174,"torrent-discovery":177,"torrent-piece":178,uniq:179,ut_metadata:180,ut_pex:50,"xtend/mutable":193}],34:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],35:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":37,"./lib/tcp-pool":38,_process:60,"addr-to-ip-port":50,buffer:51,debug:132,dezalgo:45,events:55,inherits:140,net:50,speedometer:176}],37:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":39,"bittorrent-protocol":40,debug:132}],38:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":37,_process:60,debug:132,dezalgo:45,net:50}],39:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:35,"bittorrent-protocol":40,buffer:51,debug:132,inherits:140,"simple-get":171}],40:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;n1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e); -}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":52,ieee754:53,"is-array":54}],52:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],53:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],54:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],55:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],56:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:79}],57:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],58:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],59:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function z(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],63:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended); -if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":80,_process:60,buffer:51,foreach:84,inherits:140,stream:78}],83:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],84:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],88:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n); -}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:51}],89:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:61,querystring:64}],90:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:51,defined:91,inherits:140,"readable-stream":100}],91:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t); -f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:103,"block-stream2":107,buffer:51,dezalgo:118,"filestream/read":124,flatten:125,fs:49,"is-file":126,junk:127,multistream:145,once:129,path:59,"piece-length":130,"run-parallel":166,"simple-sha1":174,stream:78}],103:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./lib/decode":104,"./lib/encode":106,dup:41}],104:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{"./dict":105,buffer:51,dup:42}],105:[function(e,t,r){arguments[4][43][0].apply(r,arguments)},{dup:43}],106:[function(e,t,r){arguments[4][44][0].apply(r,arguments)},{buffer:51,dup:44}],107:[function(e,t,r){arguments[4][90][0].apply(r,arguments)},{buffer:51,defined:108,dup:90,inherits:140,"readable-stream":117}],108:[function(e,t,r){arguments[4][91][0].apply(r,arguments)},{dup:91}],109:[function(e,t,r){arguments[4][92][0].apply(r,arguments)},{"./_stream_readable":111,"./_stream_writable":113,_process:60,"core-util-is":114,dup:92,inherits:140}],110:[function(e,t,r){arguments[4][93][0].apply(r,arguments)},{"./_stream_transform":112,"core-util-is":114,dup:93,inherits:140}],111:[function(e,t,r){arguments[4][94][0].apply(r,arguments)},{"./_stream_duplex":109,_process:60,buffer:51,"core-util-is":114,dup:94,events:55,inherits:140,isarray:115,stream:78,"string_decoder/":116,util:50}],112:[function(e,t,r){arguments[4][95][0].apply(r,arguments)},{"./_stream_duplex":109,"core-util-is":114,dup:95,inherits:140}],113:[function(e,t,r){arguments[4][96][0].apply(r,arguments)},{"./_stream_duplex":109,_process:60,buffer:51,"core-util-is":114,dup:96,inherits:140,stream:78}],114:[function(e,t,r){arguments[4][71][0].apply(r,arguments)},{buffer:51,dup:71}],115:[function(e,t,r){arguments[4][57][0].apply(r,arguments)},{dup:57}],116:[function(e,t,r){arguments[4][88][0].apply(r,arguments)},{buffer:51,dup:88}],117:[function(e,t,r){arguments[4][100][0].apply(r,arguments)},{"./lib/_stream_duplex.js":109,"./lib/_stream_passthrough.js":110,"./lib/_stream_readable.js":111,"./lib/_stream_transform.js":112,"./lib/_stream_writable.js":113,dup:100,stream:78}],118:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{asap:119,dup:14,wrappy:121}],119:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./raw":120,dup:15}],120:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{dup:16}],121:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],122:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{buffer:51,dup:21,"is-typedarray":123}],123:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{dup:20}],124:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:140,stream:78,"typedarray-to-buffer":122}],125:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],132:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{"./debug":133,dup:6}],133:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{dup:7,ms:134}],134:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{dup:8}],135:[function(e,t,r){var i=e("once");var n=function(){};var a=function(e){return e.setHeader&&typeof e.abort==="function"};var s=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var o=function(e,t,r){if(typeof t==="function")return o(e,null,t);if(!t)t={};r=i(r||n);var f=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var c=t.writable||t.writable!==false&&e.writable;var p=function(){if(!e.writable)d()};var d=function(){c=false;if(!l)r()};var h=function(){l=false;if(!c)r()};var m=function(e){r(e?new Error("exited with error code: "+e):null)};var v=function(){if(l&&!(u&&u.ended))return r(new Error("premature close"));if(c&&!(f&&f.ended))return r(new Error("premature close"))};var g=function(){e.req.on("finish",d)};if(a(e)){e.on("complete",d);e.on("abort",v);if(e.req)g();else e.on("request",g)}else if(c&&!f){e.on("end",p);e.on("close",p)}if(s(e))e.on("exit",m);e.on("end",h);e.on("finish",d);if(t.error!==false)e.on("error",r);e.on("close",v);return function(){e.removeListener("complete",d);e.removeListener("abort",v);e.removeListener("request",g);if(e.req)e.req.removeListener("finish",d);e.removeListener("end",p);e.removeListener("close",p);e.removeListener("finish",d);e.removeListener("exit",m);e.removeListener("end",h);e.removeListener("error",r);e.removeListener("close",v)}};t.exports=o},{once:137}],136:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],137:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12,wrappy:136}],138:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{dup:9}],139:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:60}],140:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{dup:10}],141:[function(e,t,r){t.exports=s;var i=e("inherits");var n=e("stream");var a=typeof window!=="undefined"&&window.MediaSource;i(s,n.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);n.Writable.call(r,t);if(!a)throw new Error("web browser lacks MediaSource support");if(!t)t={};r._elem=e;r._mediaSource=new a;r._sourceBuffer=null;r._cb=null;r._type=t.type||o(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(a.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){r._mediaSource.endOfStream()})}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);i._cb=r};s.prototype._flow=function(){var e=this;if(e._cb){e._cb(null)}};function o(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{inherits:140,stream:78}],142:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:60}],143:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:51,"thirty-two":152,uniq:179,xtend:192}],152:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":153}],153:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:51}],154:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":135,fs:49,once:162}],161:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],162:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12,wrappy:161}],163:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],164:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],165:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:55}],166:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{dezalgo:167,dup:13}],167:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{asap:168,dup:14,wrappy:170}],168:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./raw":169,dup:15}],169:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{dup:16}],170:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],171:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:51,http:79,https:56,once:173,"unzip-response":50,url:89,xtend:192}],172:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{dup:11}],173:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12,wrappy:172}],174:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:175}],175:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],176:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:181,bitfield:35,buffer:51,events:55,inherits:140,"simple-sha1":174}],181:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./lib/decode":182,"./lib/encode":184,dup:41}],182:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{"./dict":183,buffer:51,dup:42}],183:[function(e,t,r){arguments[4][43][0].apply(r,arguments)},{dup:43}],184:[function(e,t,r){arguments[4][44][0].apply(r,arguments)},{buffer:51,dup:44}],185:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],186:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":189}],188:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r; -r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],190:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:132,mp4box:190}],192:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],195:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.60.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],196:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:48,debug:120,mediasource:129,path:47,videostream:179}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:120,http:67,mime:131,pump:148,"range-parser":152,url:77}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r.path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:48,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":89,"create-torrent":90,debug:120,events:43,"fs-chunk-store":130,"immediate-chunk-store":127,inherits:128,multistream:133,os:46,"parse-torrent":134,path:47,"path-exists":147,pump:148,"random-iterate":151,"re-emitter":153,"run-parallel":154,"simple-sha1":162,"torrent-discovery":165,"torrent-piece":166,uniq:167,ut_metadata:168,ut_pex:38,"xtend/mutable":181}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:48,"addr-to-ip-port":38,buffer:39,debug:120,dezalgo:19,events:43,inherits:128,net:38,speedometer:164}],11:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":13,"bittorrent-protocol":14,debug:120}],12:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:48,debug:120,dezalgo:19,net:38}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:9,"bittorrent-protocol":14,buffer:39,debug:120,inherits:128,"simple-get":159}],14:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,"get-browser-rtc":31,hat:126,inherits:128,"is-typedarray":32,once:29,stream:66,"typedarray-to-buffer":33}],31:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],32:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],33:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:39,"is-typedarray":32}],34:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,inherits:128,"is-typedarray":35,stream:66,"typedarray-to-buffer":36,ws:38}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":35}],37:[function(e,t,r){},{}],38:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],39:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e); +if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":40,ieee754:41,"is-array":42}],40:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],41:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],42:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],43:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],44:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:67}],45:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],46:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],47:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function z(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],51:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":68,_process:48,buffer:39,foreach:72,inherits:128,stream:66}],71:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],72:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],76:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:39}],77:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){ +r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:49,querystring:52}],78:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:39,defined:79,inherits:128,"readable-stream":88}],79:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:91,"block-stream2":95,buffer:39,dezalgo:106,"filestream/read":112,flatten:113,fs:37,"is-file":114,junk:115,multistream:133,once:117,path:47,"piece-length":118,"run-parallel":154,"simple-sha1":162,stream:66}],91:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":92,"./lib/encode":94,dup:15}],92:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":93,buffer:39,dup:16}],93:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],94:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],95:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{buffer:39,defined:96,dup:78,inherits:128,"readable-stream":105}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{dup:79}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{"./_stream_readable":99,"./_stream_writable":101,_process:48,"core-util-is":102,dup:80,inherits:128}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_transform":100,"core-util-is":102,dup:81,inherits:128}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:82,events:43,inherits:128,isarray:103,stream:66,"string_decoder/":104,util:38}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":97,"core-util-is":102,dup:83,inherits:128}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:84,inherits:128,stream:66}],102:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{buffer:39,dup:59}],103:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{dup:45}],104:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{buffer:39,dup:76}],105:[function(e,t,r){arguments[4][88][0].apply(r,arguments)},{"./lib/_stream_duplex.js":97,"./lib/_stream_passthrough.js":98,"./lib/_stream_readable.js":99,"./lib/_stream_transform.js":100,"./lib/_stream_writable.js":101,dup:88,stream:66}],106:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:107,dup:19,wrappy:109}],107:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":108,dup:20}],108:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],109:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],110:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":111}],111:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],112:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:128,stream:66,"typedarray-to-buffer":110}],113:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],120:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31; +}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":121}],121:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],127:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],128:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],129:[function(e,t,r){t.exports=s;var i=e("inherits");var n=e("stream");var a=typeof window!=="undefined"&&window.MediaSource;i(s,n.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);n.Writable.call(r,t);if(!a)throw new Error("web browser lacks MediaSource support");if(!t)t={};r._elem=e;r._mediaSource=new a;r._sourceBuffer=null;r._cb=null;r._type=t.type||o(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(a.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){r._mediaSource.endOfStream()})}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);i._cb=r};s.prototype._flow=function(){var e=this;if(e._cb){e._cb(null)}};function o(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{inherits:128,stream:66}],130:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],131:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":140,uniq:167,xtend:180}],140:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":141}],141:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],142:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":123,fs:37,once:150}],149:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],150:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:149}],151:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],152:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],153:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],154:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:155}],155:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:156,dup:19,wrappy:158}],156:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":157,dup:20}],157:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],158:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],159:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:67,https:44,once:161,"unzip-response":38,url:77,xtend:180}],160:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],161:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:160}],162:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:163}],163:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],164:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:169,bitfield:9,buffer:39,events:43,inherits:128,"simple-sha1":162}],169:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":170,"./lib/encode":172,dup:15}],170:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":171,buffer:39,dup:16}],171:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],172:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],173:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],174:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":177}],176:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],178:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:120,mp4box:178}],180:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],183:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.60.1",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],184:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Sun, 16 Aug 2015 20:48:11 +0200 Subject: [PATCH 080/109] Disable DHT and PEX when the torrent is flagged as private Add test for private torrent - should disable DHT Fail public torrent test when using a private torrent standard Disable DHT for the torrent's swarm and discovery. --- lib/torrent.js | 12 +- test/download-private-dht.js | 118 +++++++++++++++++++ test/torrents/big-buck-bunny-private.torrent | Bin 0 -> 17270 bytes 3 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 test/download-private-dht.js create mode 100644 test/torrents/big-buck-bunny-private.torrent diff --git a/lib/torrent.js b/lib/torrent.js index 9d4ecdf5..0275d70c 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -196,7 +196,9 @@ Torrent.prototype._onParsedTorrent = function (parsedTorrent) { // create swarm self.swarm = new Swarm(self.infoHash, self.client.peerId, { - handshake: { dht: !!self.client.dht } + handshake: { + dht: self.private ? false : !!self.client.dht + } }) self.swarm.on('error', self._onError.bind(self)) self.swarm.on('wire', self._onWire.bind(self)) @@ -263,7 +265,9 @@ Torrent.prototype._onSwarmListening = function () { // begin discovering peers via the DHT and tracker servers self.discovery = new Discovery({ announce: self.announce, - dht: self.client.dht, + dht: self.private + ? false + : self.client.dht, tracker: self.client.tracker, peerId: self.client.peerId, port: self.client.torrentPort, @@ -587,8 +591,8 @@ Torrent.prototype._onWire = function (wire, addr) { wire.ut_metadata.fetch() } - // use ut_pex extension - if (typeof ut_pex === 'function') { + // use ut_pex extension if the torrent is not flagged as private + if (typeof ut_pex === 'function' && !self.private) { wire.use(ut_pex()) // wire.ut_pex.start() // TODO two-way communication diff --git a/test/download-private-dht.js b/test/download-private-dht.js new file mode 100644 index 00000000..14419265 --- /dev/null +++ b/test/download-private-dht.js @@ -0,0 +1,118 @@ +var auto = require('run-auto') +var DHT = require('bittorrent-dht/server') +var fs = require('fs') +var parseTorrent = require('parse-torrent') +var test = require('tape') +var WebTorrent = require('../') + +var bunnyTorrent = fs.readFileSync(__dirname + '/torrents/big-buck-bunny-private.torrent') +var bunnyParsed = parseTorrent(bunnyTorrent) + +var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesParsed = parseTorrent(leavesTorrent) + +// remove trackers from .torrent file +bunnyParsed.announce = [] +leavesParsed.announce = [] + +test('private torrent should not use DHT', function (t) { + t.plan(3) + + var dhtServer = new DHT({ bootstrap: false }) + + dhtServer.on('error', function (err) { t.fail(err) }) + dhtServer.on('warning', function (err) { t.fail(err) }) + + auto({ + dhtPort: function (cb) { + dhtServer.listen(function () { + var port = dhtServer.address().port + cb(null, port) + }) + }, + + client: ['dhtPort', function (cb, r) { + var client = new WebTorrent({ + tracker: false, + dht: { bootstrap: '127.0.0.1:' + r.dhtPort } + }) + client.on('error', function (err) { t.fail(err) }) + client.on('warning', function (err) { t.fail(err) }) + + var torrent = client.add(bunnyParsed) + + torrent.on('dhtAnnounce', function () { + t.fail('client announced to dht') + }) + + client.on('torrent', function () { + if (!torrent.discovery.dht && !torrent.swarm.handshakeOpts.dht) { + t.pass('dht is disabled for this torrent') + cb(null, client) + } + }) + + }] + + }, function (err, r) { + if (err) throw err + + dhtServer.destroy(function () { + t.pass('dht server destroyed') + }) + r.client.destroy(function () { + t.pass('client destroyed') + }) + }) +}) + +test('public torrent should use DHT', function (t) { + t.plan(3) + + var dhtServer = new DHT({ bootstrap: false }) + + dhtServer.on('error', function (err) { t.fail(err) }) + dhtServer.on('warning', function (err) { t.fail(err) }) + + auto({ + dhtPort: function (cb) { + dhtServer.listen(function () { + var port = dhtServer.address().port + cb(null, port) + }) + }, + + client: ['dhtPort', function (cb, r) { + var client = new WebTorrent({ + tracker: false, + dht: { bootstrap: '127.0.0.1:' + r.dhtPort } + }) + client.on('error', function (err) { t.fail(err) }) + client.on('warning', function (err) { t.fail(err) }) + + var torrent = client.add(leavesParsed) + + torrent.on('dhtAnnounce', function () { + t.pass('client announced to dht') + cb(null, client) + }) + + client.on('torrent', function () { + if (!torrent.client.dht) { + t.fail('dht server is null') + } + }) + + }] + + }, function (err, r) { + if (err) throw err + + dhtServer.destroy(function () { + t.pass('dht server destroyed') + }) + r.client.destroy(function () { + t.pass('client destroyed') + }) + }) +}) diff --git a/test/torrents/big-buck-bunny-private.torrent b/test/torrents/big-buck-bunny-private.torrent new file mode 100644 index 0000000000000000000000000000000000000000..25018e7ddc8c39a81fd0816dc8da39e7f00aac37 GIT binary patch literal 17270 zcmb5UQ_wIx&@A}awr$(CZQHhO+qSLuv2EM7jq}yNd-h__)wxMkCf(DWN>yr7850gJ zLpwWrS36@<78Wj769+DOdKV`{V{20Q_*MIW1|Jh(><`S|rClGQqw*GIh zv-6}OPn~Uvjuu)W+sOJ=Kr(! zACAD}Ka3?KGY2~}11CEJqbUcMshzRCiKU%6E0?N@7%c}2m!+MVy~%$ZGfNv&S`$|% zLzn-EHkNG6ET*Ra>HJUF*3`t((8iL%)Rc|O#?;Q-#ln(>nT3OylZBJfl!eRA(AJcN zfy>CqNZp|f>hVPxWRurxI`CHQ|+u`;nR zad7;X`hTL%jBIQS3|ukQ7KvBO#TOdGRktS^ViJpa+)y~Wcf|+7s)GwRga%D^=qlbu zU0Lip_TIBlvq^kfi1eh+H~Iv; zf%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)QaJ3LiXpA`O!V<1v}&IYgU=#^{sPb&h66Ozo$! zW{CoO_XqSW>pZJ%+?SdbUjnt<9cA^8Zc?mTQ}ruDMSGO?GV#}#U7H&~t?d;bOH-kjiZ>17WvlDEgsaV;5?d2rS z;^45Yf2aM~Zsm3V!qhBSt@1X1PF$Is8TjXmc<9&%4B(LHqE;r3rrK6rE5oayF2C9w z1izVHS8l;7;%ef$C#cjROhM_BcSD^Fa_|YoSe^{+dA042r932{Fj`>+#;N#2K$koF zzo!3kd)2KobM9M2M83{n{p`b(4t1WG)q&Ox+uxX~=I0uw)NgoRow=>$pxF;)gO?}k z9d@tGIW zow(1P2X-v91g;*4-1C(+#q;I0$Jb@=OwoU8rY z{_RWb`m`$Nu-j{eDt37zwFH3xhiwyted;UI>Knr@Sxiej%z9flSg%&c`fk=e**Z>r z;pD`nVQr5Ouzx)Av~+8!#p9zF*76^*5c+l0+R;w)hn%uq=M$;fVMo&AHcnYMg)JaH zR({`ZMaGVec~b*j<$9t51y8G*^`3a$G5gcfX^Bh!tMB!ks;>65$kj#nY4~Zoa%^V$MO4+406}dj*#9OmMOh&zka-!T*3rS8Hl5 z=k)mUOQ%duUCv)WyHG?lD=EA{c1M8t1sUm$N*eXojd`|u?2IWpV)P?{ox37jR#E%p zyAqQ!o&0U{mJ16?Tz+tR|Iwgip62%%tF9{6FKYZExZ;-B+XV~Ow6|Q zLK#@x#L6+u+0fLgJTnD&`huaQ5%4gERG8Sw7*gu8< literal 0 HcmV?d00001 From 4bca6bed2e3e00bc835fe1e400e36af687467592 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Mon, 31 Aug 2015 00:24:43 +0200 Subject: [PATCH 081/109] Switching to mafinstosh/chromecasts --- bin/cmd.js | 12 ++++-------- package.json | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index 816d94ec..1e393009 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -427,14 +427,10 @@ function runDownload (torrentId) { } if (argv.chromecast) { - var chromecast = require('chromecast-js') - new chromecast.Browser() - .on('deviceOn', function (device) { - device.connect() - device.on('connected', function () { - device.play(href) - }) - }) + var chromecasts = require('chromecasts')() + chromecasts.on('update', function (player) { + player.play(href) + }) } if (argv.xbmc) { diff --git a/package.json b/package.json index 18e06837..45da8669 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "main": "index.js", "optionalDependencies": { "airplay-js": "^0.2.3", - "chromecast-js": "^0.1.4", + "chromecasts": "^1.5.3", "nodebmc": "0.0.5" }, "repository": { From 764d8e1f0cdd017b93e46378e2c7f49a61c2f37f Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 2 Sep 2015 23:19:00 +0200 Subject: [PATCH 082/109] 0.61.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 45da8669..95764ad9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.60.1", + "version": "0.61.0", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From fdc77583323835c91aaa2b5a4e16201e2c40ecab Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 2 Sep 2015 23:22:35 +0200 Subject: [PATCH 083/109] build --- webtorrent.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index fae8f762..8aea3a8e 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -8,4 +8,4 @@ r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();retur "application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-nzb":["nzb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-research-info-systems":["ris"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp4":["mp4a","m4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/opentype":["otf"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-mrsid-image":["sid"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/sgml":["sgml","sgm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["markdown","md","mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-pascal":["p","pas"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],133:[function(e,t,r){t.exports=a;var i=e("inherits");var n=e("stream");i(a,n.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);n.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=typeof e==="function"?e:e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained||!this._current)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();if(typeof this._queue!=="function"){this._queue.forEach(function(e){if(e.destroy)e.destroy()})}if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;e._current=null;if(typeof e._queue==="function"){e._queue(function(t,r){if(t)return e.destroy(t);e._gotNextStream(s(r))})}else{var t=e._queue.shift();if(typeof t==="function")t=s(t());e._gotNextStream(t)}};a.prototype._gotNextStream=function(e){var t=this;if(!e){t.push(null);t.destroy();return}t._current=e;t._forward();e.on("readable",r);e.on("end",n);e.on("error",a);e.on("close",i);function r(){t._forward()}function i(){if(!e._readableState.ended){t.destroy()}}function n(){t._current=null;e.removeListener("readable",r);e.removeListener("end",n);e.removeListener("error",a);e.removeListener("close",i);t._next()}function a(e){t.destroy(e)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new n.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:128,stream:66}],134:[function(e,t,r){(function(r){t.exports=f;t.exports.remote=u;var i=e("dezalgo");var n=e("fs");var a=e("simple-get");var s=e("magnet-uri");var o=e("parse-torrent-file");t.exports.toMagnetURI=s.encode;t.exports.toTorrentFile=o.encode;function f(e){var t=e&&e.length;if(typeof e==="string"&&/magnet:/.test(e)){return s(e)}else if(typeof e==="string"&&(t===40||t===32)){return s("magnet:?xt=urn:btih:"+e)}else if(r.isBuffer(e)&&t===20){return s("magnet:?xt=urn:btih:"+e.toString("hex"))}else if(r.isBuffer(e)){return o(e)}else if(e&&e.infoHash){if(!e.announce)e.announce=[];if(typeof e.announce==="string"){e.announce=[e.announce]}return e}else{throw new Error("Invalid torrent identifier")}}function u(e,t){var r;if(typeof t!=="function")throw new Error("second argument must be a Function");t=i(t);try{r=f(e)}catch(s){}if(r&&r.infoHash){t(null,r)}else if(typeof a==="function"&&/^https?:/.test(e)){a.concat({url:e,headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e){e=new Error("Error downloading torrent: "+e.message);return t(e)}o(r)})}else if(typeof n.readFile==="function"&&typeof e==="string"){n.readFile(e,function(e,r){if(e)return t(new Error("Invalid torrent identifier"));o(r)})}else{t(new Error("Invalid torrent identifier"))}function o(e){try{r=f(e)}catch(i){return t(i)}if(r&&r.infoHash)t(null,r);else t(new Error("Invalid torrent identifier"))}}}).call(this,e("buffer").Buffer)},{buffer:39,dezalgo:135,fs:37,"magnet-uri":139,"parse-torrent-file":142,"simple-get":159}],135:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:136,dup:19,wrappy:138}],136:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":137,dup:20}],137:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],138:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],139:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var i=e("thirty-two");var n=e("xtend");var a=e("uniq");function s(e){var t={};var n=e.split("magnet:?")[1];var s=n&&n.length>=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":140,uniq:167,xtend:180}],140:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":141}],141:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],142:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":123,fs:37,once:150}],149:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],150:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:149}],151:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],152:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],153:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],154:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:155}],155:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:156,dup:19,wrappy:158}],156:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":157,dup:20}],157:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],158:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],159:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:67,https:44,once:161,"unzip-response":38,url:77,xtend:180}],160:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],161:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:160}],162:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:163}],163:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],164:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:169,bitfield:9,buffer:39,events:43,inherits:128,"simple-sha1":162}],169:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":170,"./lib/encode":172,dup:15}],170:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":171,buffer:39,dup:16}],171:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],172:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],173:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],174:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":177}],176:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],178:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:120,mp4box:178}],180:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],183:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.60.1",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3","chromecast-js":"^0.1.4",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],184:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],178:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:120,mp4box:178}],180:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],183:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.61.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],184:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Wed, 2 Sep 2015 23:24:24 +0200 Subject: [PATCH 084/109] 0.62.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 95764ad9..aee2a2d1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.61.0", + "version": "0.62.0", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From f4b04d0d387f6cc6d976709fa4ef6427ce3849a8 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 2 Sep 2015 23:25:33 +0200 Subject: [PATCH 085/109] build --- webtorrent.min.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 8aea3a8e..543b64c0 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,11 +1,11 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:48,debug:120,mediasource:129,path:47,videostream:179}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:120,http:67,mime:131,pump:148,"range-parser":152,url:77}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r.path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:48,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":89,"create-torrent":90,debug:120,events:43,"fs-chunk-store":130,"immediate-chunk-store":127,inherits:128,multistream:133,os:46,"parse-torrent":134,path:47,"path-exists":147,pump:148,"random-iterate":151,"re-emitter":153,"run-parallel":154,"simple-sha1":162,"torrent-discovery":165,"torrent-piece":166,uniq:167,ut_metadata:168,ut_pex:38,"xtend/mutable":181}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:48,"addr-to-ip-port":38,buffer:39,debug:120,dezalgo:19,events:43,inherits:128,net:38,speedometer:164}],11:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":13,"bittorrent-protocol":14,debug:120}],12:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:48,debug:120,dezalgo:19,net:38}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:9,"bittorrent-protocol":14,buffer:39,debug:120,inherits:128,"simple-get":159}],14:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,"get-browser-rtc":31,hat:126,inherits:128,"is-typedarray":32,once:29,stream:66,"typedarray-to-buffer":33}],31:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],32:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],33:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:39,"is-typedarray":32}],34:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,inherits:128,"is-typedarray":35,stream:66,"typedarray-to-buffer":36,ws:38}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":35}],37:[function(e,t,r){},{}],38:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],39:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e); -if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":40,ieee754:41,"is-array":42}],40:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],41:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],42:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],43:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],44:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:67}],45:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],46:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],47:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function z(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],51:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":68,_process:48,buffer:39,foreach:72,inherits:128,stream:66}],71:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],72:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],76:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:39}],77:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){ -r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:49,querystring:52}],78:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:39,defined:79,inherits:128,"readable-stream":88}],79:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:91,"block-stream2":95,buffer:39,dezalgo:106,"filestream/read":112,flatten:113,fs:37,"is-file":114,junk:115,multistream:133,once:117,path:47,"piece-length":118,"run-parallel":154,"simple-sha1":162,stream:66}],91:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":92,"./lib/encode":94,dup:15}],92:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":93,buffer:39,dup:16}],93:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],94:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],95:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{buffer:39,defined:96,dup:78,inherits:128,"readable-stream":105}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{dup:79}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{"./_stream_readable":99,"./_stream_writable":101,_process:48,"core-util-is":102,dup:80,inherits:128}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_transform":100,"core-util-is":102,dup:81,inherits:128}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:82,events:43,inherits:128,isarray:103,stream:66,"string_decoder/":104,util:38}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":97,"core-util-is":102,dup:83,inherits:128}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:84,inherits:128,stream:66}],102:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{buffer:39,dup:59}],103:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{dup:45}],104:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{buffer:39,dup:76}],105:[function(e,t,r){arguments[4][88][0].apply(r,arguments)},{"./lib/_stream_duplex.js":97,"./lib/_stream_passthrough.js":98,"./lib/_stream_readable.js":99,"./lib/_stream_transform.js":100,"./lib/_stream_writable.js":101,dup:88,stream:66}],106:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:107,dup:19,wrappy:109}],107:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":108,dup:20}],108:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],109:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],110:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":111}],111:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],112:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:128,stream:66,"typedarray-to-buffer":110}],113:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],120:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31; +(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:48,debug:120,mediasource:129,path:47,videostream:179}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:120,http:67,mime:131,pump:148,"range-parser":152,url:77}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r.path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:48,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":89,"create-torrent":90,debug:120,events:43,"fs-chunk-store":130,"immediate-chunk-store":127,inherits:128,multistream:133,os:46,"parse-torrent":134,path:47,"path-exists":147,pump:148,"random-iterate":151,"re-emitter":153,"run-parallel":154,"simple-sha1":162,"torrent-discovery":165,"torrent-piece":166,uniq:167,ut_metadata:168,ut_pex:38,"xtend/mutable":181}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:48,"addr-to-ip-port":38,buffer:39,debug:120,dezalgo:19,events:43,inherits:128,net:38,speedometer:164}],11:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":13,"bittorrent-protocol":14,debug:120}],12:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:48,debug:120,dezalgo:19,net:38}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:9,"bittorrent-protocol":14,buffer:39,debug:120,inherits:128,"simple-get":159}],14:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,"get-browser-rtc":31,hat:126,inherits:128,"is-typedarray":32,once:29,stream:66,"typedarray-to-buffer":33}],31:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],32:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],33:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:39,"is-typedarray":32}],34:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,inherits:128,"is-typedarray":35,stream:66,"typedarray-to-buffer":36,ws:38}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":35}],37:[function(e,t,r){},{}],38:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],39:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){ +e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":40,ieee754:41,"is-array":42}],40:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],41:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],42:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],43:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],44:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:67}],45:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],46:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],47:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function z(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],51:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true; +t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":68,_process:48,buffer:39,foreach:72,inherits:128,stream:66}],71:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],72:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],76:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:39}],77:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift(); +r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:49,querystring:52}],78:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:39,defined:79,inherits:128,"readable-stream":88}],79:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:91,"block-stream2":95,buffer:39,dezalgo:106,"filestream/read":112,flatten:113,fs:37,"is-file":114,junk:115,multistream:133,once:117,path:47,"piece-length":118,"run-parallel":154,"simple-sha1":162,stream:66}],91:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":92,"./lib/encode":94,dup:15}],92:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":93,buffer:39,dup:16}],93:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],94:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],95:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{buffer:39,defined:96,dup:78,inherits:128,"readable-stream":105}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{dup:79}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{"./_stream_readable":99,"./_stream_writable":101,_process:48,"core-util-is":102,dup:80,inherits:128}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_transform":100,"core-util-is":102,dup:81,inherits:128}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:82,events:43,inherits:128,isarray:103,stream:66,"string_decoder/":104,util:38}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":97,"core-util-is":102,dup:83,inherits:128}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:84,inherits:128,stream:66}],102:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{buffer:39,dup:59}],103:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{dup:45}],104:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{buffer:39,dup:76}],105:[function(e,t,r){arguments[4][88][0].apply(r,arguments)},{"./lib/_stream_duplex.js":97,"./lib/_stream_passthrough.js":98,"./lib/_stream_readable.js":99,"./lib/_stream_transform.js":100,"./lib/_stream_writable.js":101,dup:88,stream:66}],106:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:107,dup:19,wrappy:109}],107:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":108,dup:20}],108:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],109:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],110:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":111}],111:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],112:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:128,stream:66,"typedarray-to-buffer":110}],113:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],120:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31; }r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":121}],121:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],127:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],128:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],129:[function(e,t,r){t.exports=s;var i=e("inherits");var n=e("stream");var a=typeof window!=="undefined"&&window.MediaSource;i(s,n.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);n.Writable.call(r,t);if(!a)throw new Error("web browser lacks MediaSource support");if(!t)t={};r._elem=e;r._mediaSource=new a;r._sourceBuffer=null;r._cb=null;r._type=t.type||o(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(a.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){r._mediaSource.endOfStream()})}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);i._cb=r};s.prototype._flow=function(){var e=this;if(e._cb){e._cb(null)}};function o(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{inherits:128,stream:66}],130:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],131:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":140,uniq:167,xtend:180}],140:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":141}],141:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],142:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":123,fs:37,once:150}],149:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],150:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:149}],151:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],152:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],153:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],154:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:155}],155:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:156,dup:19,wrappy:158}],156:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":157,dup:20}],157:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],158:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],159:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:67,https:44,once:161,"unzip-response":38,url:77,xtend:180}],160:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],161:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:160}],162:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:163}],163:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],164:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:169,bitfield:9,buffer:39,events:43,inherits:128,"simple-sha1":162}],169:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":170,"./lib/encode":172,dup:15}],170:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":171,buffer:39,dup:16}],171:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],172:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],173:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],174:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":177}],176:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],178:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:120,mp4box:178}],180:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],183:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.61.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],184:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],178:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:120,mp4box:178}],180:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],183:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],184:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Thu, 3 Sep 2015 01:13:32 +0200 Subject: [PATCH 086/109] Clone options when seeding/downloading --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 1f24c4b6..f44e3865 100644 --- a/index.js +++ b/index.js @@ -145,6 +145,7 @@ WebTorrent.prototype.download = function (torrentId, opts, ontorrent) { if (typeof opts === 'function') return self.add(torrentId, null, opts) debug('add') if (!opts) opts = {} + else opts = extend({}, opts) opts.client = self @@ -192,6 +193,7 @@ WebTorrent.prototype.seed = function (input, opts, onseed) { if (typeof opts === 'function') return self.seed(input, null, opts) debug('seed') if (!opts) opts = {} + else opts = extend({}, opts) // When seeding from filesystem, initialize store from that path (avoids a copy) if (typeof input === 'string') opts.path = path.dirname(input) From 0bfdb753ab25212cc83d48b24f8a54fe07e3c93e Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 3 Sep 2015 16:14:17 +0200 Subject: [PATCH 087/109] standard --- test/blocklist-dht.js | 1 - test/download-private-dht.js | 2 -- test/download-tracker-torrent.js | 1 - 3 files changed, 4 deletions(-) diff --git a/test/blocklist-dht.js b/test/blocklist-dht.js index 6d4c1c9e..113d9afc 100644 --- a/test/blocklist-dht.js +++ b/test/blocklist-dht.js @@ -63,7 +63,6 @@ test('blocklist blocks peers discovered via DHT', function (t) { function maybeDone () { if (torrentReady && announced) cb(null, client1) } - }], client2: ['client1', function (cb, r) { diff --git a/test/download-private-dht.js b/test/download-private-dht.js index 14419265..ca24cd7a 100644 --- a/test/download-private-dht.js +++ b/test/download-private-dht.js @@ -51,7 +51,6 @@ test('private torrent should not use DHT', function (t) { cb(null, client) } }) - }] }, function (err, r) { @@ -102,7 +101,6 @@ test('public torrent should use DHT', function (t) { t.fail('dht server is null') } }) - }] }, function (err, r) { diff --git a/test/download-tracker-torrent.js b/test/download-tracker-torrent.js index 1fbe54fb..909fcaa6 100644 --- a/test/download-tracker-torrent.js +++ b/test/download-tracker-torrent.js @@ -101,7 +101,6 @@ function torrentDownloadTest (t, serverType) { if (gotBuffer && torrentDone) cb(null, client2) } }) - }] }, function (err, r) { From f028fa380e06a30d06f02c157a72684e32dbc8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Galliat?= Date: Thu, 10 Sep 2015 18:47:15 +0200 Subject: [PATCH 088/109] Always pass 'elem' to 'append-to' callback Looks like it was forgotten for 'img' and 'iframe'. --- lib/append-to.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/append-to.js b/lib/append-to.js index 8976e56d..c68e3f94 100644 --- a/lib/append-to.js +++ b/lib/append-to.js @@ -136,7 +136,7 @@ module.exports = function appendTo (file, rootElem, cb) { elem.src = url elem.alt = file.name rootElem.appendChild(elem) - cb(null) + cb(null, elem) }) } @@ -147,7 +147,7 @@ module.exports = function appendTo (file, rootElem, cb) { elem.src = url if (extname !== '.pdf') elem.sandbox = 'allow-forms allow-scripts' rootElem.appendChild(elem) - cb(null) + cb(null, elem) }) } From fb715652f974a83ae6ed37dfc91e937155085ed3 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 16 Sep 2015 14:27:55 -0700 Subject: [PATCH 089/109] standard --- index.js | 8 +++++--- lib/torrent.js | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index f44e3865..9e783bee 100644 --- a/index.js +++ b/index.js @@ -201,9 +201,11 @@ WebTorrent.prototype.seed = function (input, opts, onseed) { var streams var torrent = self.add(undefined, opts, function (torrent) { - var tasks = [function (cb) { - torrent.load(streams, cb) - }] + var tasks = [ + function (cb) { + torrent.load(streams, cb) + } + ] if (self.dht) { tasks.push(function (cb) { torrent.on('dhtAnnounce', cb) diff --git a/lib/torrent.js b/lib/torrent.js index 0275d70c..6b58f776 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -796,7 +796,8 @@ Torrent.prototype._updateWire = function (wire) { function validateWire () { if (wire.requests.length) return - for (var i = self._selections.length; i--;) { + var i = self._selections.length + while (i--) { var next = self._selections[i] var piece if (self.strategy === 'rarest') { From 28fb2ef65a45e77968b5ca0dcbf4ef0295c25568 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 21 Sep 2015 17:26:49 -0700 Subject: [PATCH 090/109] 0.62.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aee2a2d1..2eae70e4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.62.0", + "version": "0.62.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From 8005eb80d3da58fd02421ea88832165659481a93 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 21 Sep 2015 17:27:44 -0700 Subject: [PATCH 091/109] build --- webtorrent.min.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 543b64c0..71d93dd5 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,11 +1,12 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:48,debug:120,mediasource:129,path:47,videostream:179}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:120,http:67,mime:131,pump:148,"range-parser":152,url:77}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var I=e("ut_metadata");var T=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r.path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;for(var r=t._selections.length;r--;){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:48,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":89,"create-torrent":90,debug:120,events:43,"fs-chunk-store":130,"immediate-chunk-store":127,inherits:128,multistream:133,os:46,"parse-torrent":134,path:47,"path-exists":147,pump:148,"random-iterate":151,"re-emitter":153,"run-parallel":154,"simple-sha1":162,"torrent-discovery":165,"torrent-piece":166,uniq:167,ut_metadata:168,ut_pex:38,"xtend/mutable":181}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)n={};if(!n[e]){var t=i.exec(e);if(!t)throw new Error("invalid addr: "+e);n[e]=[t[1],Number(t[2])];a+=1}return n[e]};t.exports.reset=function o(){n={}}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:48,"addr-to-ip-port":38,buffer:39,debug:120,dezalgo:19,events:43,inherits:128,net:38,speedometer:164}],11:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":13,"bittorrent-protocol":14,debug:120}],12:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:48,debug:120,dezalgo:19,net:38}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:9,"bittorrent-protocol":14,buffer:39,debug:120,inherits:128,"simple-get":159}],14:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,"get-browser-rtc":31,hat:126,inherits:128,"is-typedarray":32,once:29,stream:66,"typedarray-to-buffer":33}],31:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],32:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],33:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:39,"is-typedarray":32}],34:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,e("buffer").Buffer)},{buffer:39,debug:120,inherits:128,"is-typedarray":35,stream:66,"typedarray-to-buffer":36,ws:38}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":35}],37:[function(e,t,r){},{}],38:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],39:[function(e,t,r){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return $(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){ -e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function Ke(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function $e(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}},{"base64-js":40,ieee754:41,"is-array":42}],40:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],41:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],42:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],43:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],44:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";return i.request.call(this,e,t)}},{http:67}],45:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],46:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],47:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function I(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function T(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function z(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=T(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],51:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=T(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");I(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true; -t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var a=r.substr(e._pos);if(e._charset==="x-user-defined"){var s=new i(a.length);for(var o=0;oe._pos){e.push(new i(new Uint8Array(u.result.slice(e._pos))));e._pos=u.result.byteLength}};u.onload=function(){e.push(null)};u.readAsArrayBuffer(r);break}if(e._xhr.readyState===f.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),e("buffer").Buffer)},{"./capability":68,_process:48,buffer:39,foreach:72,inherits:128,stream:66}],71:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],72:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var d=0;d0){for(var h=0;h=0&&i.call(e.callee)==="[object Function]"}return r}},{}],76:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:39}],77:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){T+="x"}else{T+=I[L]}}if(!T.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=I.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift(); -r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:49,querystring:52}],78:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:39,defined:79,inherits:128,"readable-stream":88}],79:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)I(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)I(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)I(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function T(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function I(e){return typeof Blob!=="undefined"&&e instanceof Blob}function T(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:91,"block-stream2":95,buffer:39,dezalgo:106,"filestream/read":112,flatten:113,fs:37,"is-file":114,junk:115,multistream:133,once:117,path:47,"piece-length":118,"run-parallel":154,"simple-sha1":162,stream:66}],91:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":92,"./lib/encode":94,dup:15}],92:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":93,buffer:39,dup:16}],93:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],94:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],95:[function(e,t,r){arguments[4][78][0].apply(r,arguments)},{buffer:39,defined:96,dup:78,inherits:128,"readable-stream":105}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{dup:79}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{"./_stream_readable":99,"./_stream_writable":101,_process:48,"core-util-is":102,dup:80,inherits:128}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_transform":100,"core-util-is":102,dup:81,inherits:128}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:82,events:43,inherits:128,isarray:103,stream:66,"string_decoder/":104,util:38}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":97,"core-util-is":102,dup:83,inherits:128}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":97,_process:48,buffer:39,"core-util-is":102,dup:84,inherits:128,stream:66}],102:[function(e,t,r){arguments[4][59][0].apply(r,arguments)},{buffer:39,dup:59}],103:[function(e,t,r){arguments[4][45][0].apply(r,arguments)},{dup:45}],104:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{buffer:39,dup:76}],105:[function(e,t,r){arguments[4][88][0].apply(r,arguments)},{"./lib/_stream_duplex.js":97,"./lib/_stream_passthrough.js":98,"./lib/_stream_readable.js":99,"./lib/_stream_transform.js":100,"./lib/_stream_writable.js":101,dup:88,stream:66}],106:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:107,dup:19,wrappy:109}],107:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":108,dup:20}],108:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],109:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],110:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":111}],111:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],112:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null);return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:128,stream:66,"typedarray-to-buffer":110}],113:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],120:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31; -}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":121}],121:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],127:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],128:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],129:[function(e,t,r){t.exports=s;var i=e("inherits");var n=e("stream");var a=typeof window!=="undefined"&&window.MediaSource;i(s,n.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);n.Writable.call(r,t);if(!a)throw new Error("web browser lacks MediaSource support");if(!t)t={};r._elem=e;r._mediaSource=new a;r._sourceBuffer=null;r._cb=null;r._type=t.type||o(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(a.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){r._mediaSource.endOfStream()})}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);i._cb=r};s.prototype._flow=function(){var e=this;if(e._cb){e._cb(null)}};function o(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{inherits:128,stream:66}],130:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:48}],131:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":140,uniq:167,xtend:180}],140:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":141}],141:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],142:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":123,fs:37,once:150}],149:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],150:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:149}],151:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],152:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],153:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],154:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:155}],155:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:156,dup:19,wrappy:158}],156:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":157,dup:20}],157:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],158:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],159:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:67,https:44,once:161,"unzip-response":38,url:77,xtend:180}],160:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],161:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:160}],162:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:163}],163:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],164:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:169,bitfield:9,buffer:39,events:43,inherits:128,"simple-sha1":162}],169:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":170,"./lib/encode":172,dup:15}],170:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":171,buffer:39,dup:16}],171:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],172:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],173:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],174:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":177}],176:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],178:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:120,mp4box:178}],180:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],183:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.0",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],184:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null,u)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null,u)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:49,debug:121,mediasource:130,path:48,videostream:180}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:121,http:68,mime:132,pump:149,"range-parser":153,url:78}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var T=e("ut_metadata");var I=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r.path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;var r=t._selections.length;while(r--){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:49,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":90,"create-torrent":91,debug:121,events:43,"fs-chunk-store":131,"immediate-chunk-store":128,inherits:129,multistream:134,os:47,"parse-torrent":135,path:48,"path-exists":148,pump:149,"random-iterate":152,"re-emitter":154,"run-parallel":155,"simple-sha1":163,"torrent-discovery":166,"torrent-piece":167,uniq:168,ut_metadata:169,ut_pex:38,"xtend/mutable":182}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)t.exports.reset();if(!n[e]){var r=i.exec(e);if(!r)throw new Error("invalid addr: "+e);n[e]=[r[1],Number(r[2])];a+=1}return n[e]};t.exports.reset=function o(){n={};a=0}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:49,"addr-to-ip-port":38,buffer:39,debug:121,dezalgo:19,events:43,inherits:129,net:38,speedometer:165}],11:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":13,"bittorrent-protocol":14,debug:121}],12:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:49,debug:121,dezalgo:19,net:38}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:9,"bittorrent-protocol":14,buffer:39,debug:121,inherits:129,"simple-get":160}],14:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,{isBuffer:e("/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")})},{"/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":45,debug:121,"get-browser-rtc":31,hat:127,inherits:129,"is-typedarray":32,once:29,stream:67,"typedarray-to-buffer":33}],31:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],32:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],33:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:39,"is-typedarray":32}],34:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,{isBuffer:e("/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")})},{"/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":45,debug:121,inherits:129,"is-typedarray":35,stream:67,"typedarray-to-buffer":36,ws:38}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":35}],37:[function(e,t,r){},{}],38:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],39:[function(e,t,r){(function(t){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=t.TYPED_ARRAY_SUPPORT!==undefined?t.TYPED_ARRAY_SUPPORT:function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return K(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4; +};f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function $e(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ke(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"base64-js":40,ieee754:41,"is-array":42}],40:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],41:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],42:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],43:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],44:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";e.protocol="https:";return i.request.call(this,e,t)}},{http:68}],45:[function(e,t,r){t.exports=function(e){return!!(e!=null&&(e._isBuffer||e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)))}},{}],46:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],47:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],48:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function T(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function I(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function z(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=I(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],52:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=I(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(n)o=r.join("");else o=a.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;i(B,t,e)}}function B(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function C(e,t){for(var r=0,i=e.length;r-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e};function d(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=new n(t,r)}return t}function h(e,t,r,i,a){r=d(t,r,i);if(n.isBuffer(r))i="buffer";var s=t.objectMode?1:r.length;t.length+=s;var o=t.lengthe._pos){var s=r.substr(e._pos);if(e._charset==="x-user-defined"){var o=new n(s.length);for(var f=0;fe._pos){e.push(new n(new Uint8Array(l.result.slice(e._pos))));e._pos=l.result.byteLength}};l.onload=function(){e.push(null)};l.readAsArrayBuffer(r);break}if(e._xhr.readyState===u.DONE&&e._mode!=="ms-stream"){e.push(null)}}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{"./capability":69,_process:49,buffer:39,foreach:73,inherits:129,stream:67}],72:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],73:[function(e,t,r){var i=Object.prototype.hasOwnProperty;var n=Object.prototype.toString;t.exports=function a(e,t,r){if(n.call(t)!=="[object Function]"){throw new TypeError("iterator must be a function")}var a=e.length;if(a===+a){for(var s=0;s0&&!i.call(e,0)){for(var h=0;h0){for(var m=0;m=0&&i.call(e.callee)==="[object Function]"}return r}},{}],77:[function(e,t,r){var i=e("buffer").Buffer;var n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function a(e){if(e&&!n(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");a(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=o;return}this.charBuffer=new i(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived=55296&&i<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var n=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,n);n-=this.charReceived}t+=e.toString(this.encoding,0,n);var n=t.length-1;var i=t.charCodeAt(n);if(i>=55296&&i<=56319){var a=this.surrogateSize;this.charLength+=a;this.charReceived+=a;this.charBuffer.copy(this.charBuffer,a,0,a);e.copy(this.charBuffer,0,0,a);return t.substring(0,n)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var i=this.charBuffer;var n=this.encoding;t+=i.slice(0,r).toString(n)}return t};function o(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:39}],78:[function(e,t,r){var i=e("punycode");r.parse=_;r.resolve=w;r.resolveObject=x;r.format=b;r.Url=n;function n(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,o=["<",">",'"',"`"," ","\r","\n"," "],f=["{","}","|","\\","^","`"].concat(o),u=["'"].concat(f),l=["%","/","?",";","#"].concat(u),c=["/","?","#"],p=255,d=/^[a-z0-9A-Z_-]{0,63}$/,h=/^([a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:true,"javascript:":true},v={javascript:true,"javascript:":true},g={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},y=e("querystring");function _(e,t,r){if(e&&S(e)&&e instanceof n)return e;var i=new n;i.parse(e,t,r);return i}n.prototype.parse=function(e,t,r){if(!k(e)){throw new TypeError("Parameter 'url' must be a string, not "+typeof e)}var n=e;n=n.trim();var s=a.exec(n);if(s){s=s[0];var o=s.toLowerCase();this.protocol=o;n=n.substr(s.length)}if(r||s||n.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=n.substr(0,2)==="//";if(f&&!(s&&v[s])){n=n.substr(2);this.slashes=true}}if(!v[s]&&(f||s&&!g[s])){var _=-1;for(var b=0;b127){I+="x"}else{I+=T[L]}}if(!I.match(d)){var C=A.slice(0,b);var R=A.slice(b+1);var P=T.match(h);if(P){C.push(P[1]);R.unshift(P[2])}if(R.length){n="/"+R.join(".")+n}this.hostname=C.join(".");break}}}}if(this.hostname.length>p){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!E){var z=this.hostname.split(".");var O=[];for(var b=0;b0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}r.search=e.search;r.query=e.query;if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.href=r.format();return r}if(!c.length){r.pathname=null;if(r.search){r.path="/"+r.search}else{r.path=null}r.href=r.format();return r}var h=c.slice(-1)[0];var m=(r.host||e.host)&&(h==="."||h==="..")||h==="";var y=0;for(var _=c.length;_>=0;_--){h=c[_];if(h=="."){c.splice(_,1)}else if(h===".."){c.splice(_,1);y++}else if(y){c.splice(_,1);y--}}if(!u&&!l){for(;y--;y){c.unshift("..")}}if(u&&c[0]!==""&&(!c[0]||c[0].charAt(0)!=="/")){c.unshift("")}if(m&&c.join("/").substr(-1)!=="/"){c.push("")}var b=c[0]===""||c[0]&&c[0].charAt(0)==="/";if(p){r.hostname=r.host=b?"":c.length?c.shift():"";var d=r.host&&r.host.indexOf("@")>0?r.host.split("@"):false;if(d){r.auth=d.shift();r.host=r.hostname=d.shift()}}u=u||r.host&&c.length;if(u&&!b){c.unshift("")}if(!c.length){r.pathname=null;r.path=null}else{r.pathname=c.join("/")}if(!E(r.pathname)||!E(r.search)){r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")}r.auth=e.auth||r.auth;r.slashes=r.slashes||e.slashes;r.href=r.format();return r};n.prototype.parseHost=function(){var e=this.host;var t=s.exec(e);if(t){t=t[0];if(t!==":"){this.port=t.substr(1)}e=e.substr(0,e.length-t.length)}if(e)this.hostname=e};function k(e){return typeof e==="string"}function S(e){return typeof e==="object"&&e!==null}function E(e){return e===null}function A(e){return e==null}},{punycode:50,querystring:53}],79:[function(e,t,r){(function(r){var i=e("inherits");var n=e("readable-stream").Transform;var a=e("defined");t.exports=s;i(s,n);function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this);if(!t)t={};if(typeof e==="object"){t=e;e=t.size}this.size=e||512;if(t.nopad)this._zeroPadding=false;else this._zeroPadding=a(t.zeroPadding,true);this._buffered=[];this._bufferedBytes=0}s.prototype._transform=function(e,t,i){this._bufferedBytes+=e.length;this._buffered.push(e);while(this._bufferedBytes>=this.size){var n=r.concat(this._buffered);this._bufferedBytes-=this.size;this.push(n.slice(0,this.size));this._buffered=[n.slice(this.size,n.length)]}i()};s.prototype._flush=function(){if(this._bufferedBytes&&this._zeroPadding){var e=new r(this.size-this._bufferedBytes);e.fill(0);this._buffered.push(e);this.push(r.concat(this._buffered));this._buffered=null}else if(this._bufferedBytes){this.push(r.concat(this._buffered));this._buffered=null}this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:39,defined:80,inherits:129,"readable-stream":89}],80:[function(e,t,r){t.exports=function(){for(var e=0;e0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)_(e)}w(e,t)}}else if(!n){t.reading=false}return d(t)}function d(e){return!e.ended&&(e.needReadable||e.length=h){e=h}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function v(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(isNaN(e)||o.isNull(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=m(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else return t.length}return e}c.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(!o.isNumber(e)||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)T(this);else _(this);return null}e=v(e,t);if(e===0&&t.ended){if(t.length===0)T(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=U(e,t);else n=null;if(o.isNull(n)){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)T(this);if(!o.isNull(n))this.emit("data",n);return n};function g(e,t){var r=null;if(!o.isBuffer(t)&&!o.isString(t)&&!o.isNullOrUndefined(t)&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function y(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;_(e)}function _(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)r.nextTick(function(){b(e)});else b(e)}}function b(e){u("emit readable");e.emit("readable");A(e)}function w(e,t){if(!t.readingMore){t.readingMore=true;r.nextTick(function(){x(e,t)})}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=i){if(a)o=r.join("");else o=n.concat(r,i);r.length=0}else{if(e0)throw new Error("endReadable called on non-empty stream");if(!t.endEmitted){t.ended=true;r.nextTick(function(){if(!t.endEmitted&&t.length===0){t.endEmitted=true;e.readable=false;e.emit("end")}})}}function I(e,t){for(var r=0,i=e.length;r1){var r=[];for(var i=0;i1||a;w(e,f,r);return}else{throw new Error("invalid input type")}if(!e.name)throw new Error("missing requied `name` property on input");s.path=e.name.split(o.sep);r(null,s)}}),function(e,t){if(e)return r(e);t=l(t);r(null,t,a)})}}function w(e,t,r){k(e,x,function(i,n){if(i)return r(i);if(Array.isArray(n))n=l(n);else n=[n];e=o.normalize(e);if(t){e=e.slice(0,e.lastIndexOf(o.sep)+1)}if(e[e.length-1]!==o.sep)e+=o.sep;n.forEach(function(t){t.getStream=R(t.path);t.path=t.path.replace(e,"").split(o.sep)});r(null,n)})}function x(e,t){t=m(t);c.stat(e,function(r,i){if(r)return t(r);var n={length:i.size,path:e};t(null,n)})}function k(e,t,r){c.readdir(e,function(i,n){if(i&&i.code==="ENOTDIR"){t(e,r)}else if(i){r(i)}else{v(n.filter(S).filter(d.not).map(function(r){return function(i){k(o.join(e,r),t,i)}}),r)}})}function S(e){return e[0]!=="."}function E(e,t,r){r=m(r);var n=[];var s=0;var o=e.map(function(e){return e.getStream});var f=0;var u=0;var l=false;var c=new h(o);var p=new a(t,{zeroPadding:false});c.on("error",y);c.pipe(p).on("data",d).on("end",v).on("error",y);function d(e){s+=e.length;var t=u;g(e,function(e){n[t]=e;f-=1;b()});f+=1;u+=1}function v(){l=true;b()}function y(e){_();r(e)}function _(){c.removeListener("error",y);p.removeListener("data",d);p.removeListener("end",v);p.removeListener("error",y)}function b(){if(l&&f===0){_();r(null,new i(n.join(""),"hex"),s)}}}function A(e,i,a){var o=i.announceList;if(!o){if(typeof i.announce==="string")o=[[i.announce]];else if(Array.isArray(i.announce)){o=i.announce.map(function(e){return[e]})}}if(!o)o=[];if(r.WEBTORRENT_ANNOUNCE){if(typeof r.WEBTORRENT_ANNOUNCE==="string"){o.push([[r.WEBTORRENT_ANNOUNCE]])}else if(Array.isArray(r.WEBTORRENT_ANNOUNCE)){o=o.concat(r.WEBTORRENT_ANNOUNCE.map(function(e){return[e]}))}}if(o.length===0){o=o.concat(t.exports.announceList)}if(typeof i.urlList==="string")i.urlList=[i.urlList];var f={info:{name:i.name},announce:o[0][0],"announce-list":o,"creation date":Number(i.creationDate)||Date.now(),encoding:"UTF-8"};if(i.comment!==undefined)f.comment=i.comment;if(i.createdBy!==undefined)f["created by"]=i.createdBy;if(i.private!==undefined)f.info.private=Number(i.private);if(i.sslCert!==undefined)f.info["ssl-cert"]=i.sslCert;if(i.urlList!==undefined)f["url-list"]=i.urlList;var u=i.pieceLength||s(e.reduce(U,0));f.info["piece length"]=u;E(e,u,function(t,r,s){if(t)return a(t);f.info.pieces=r;e.forEach(function(e){delete e.getStream});if(i.singleFileTorrent){f.info.length=s}else{f.info.files=e}a(null,n.encode(f))})}function U(e,t){return e+t.length}function T(e){return typeof Blob!=="undefined"&&e instanceof Blob}function I(e){return typeof FileList==="function"&&e instanceof FileList}function L(e){return typeof e==="object"&&typeof e.pipe==="function"}function B(e){return function(){return new u(e)}}function C(e){return function(){var t=new y.PassThrough;t.end(e);return t}}function R(e){return function(){return c.createReadStream(e)}}function P(e,t){return function(){var r=new y.Transform;r._transform=function(e,r,i){t.length+=e.length;this.push(e);i()};e.pipe(r);return r}}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{bencode:92,"block-stream2":96,buffer:39,dezalgo:107,"filestream/read":113,flatten:114,fs:37,"is-file":115,junk:116,multistream:134,once:118,path:48,"piece-length":119,"run-parallel":155,"simple-sha1":163,stream:67}],92:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":93,"./lib/encode":95,dup:15}],93:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":94,buffer:39,dup:16}],94:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],95:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],96:[function(e,t,r){arguments[4][79][0].apply(r,arguments)},{buffer:39,defined:97,dup:79,inherits:129,"readable-stream":106}],97:[function(e,t,r){arguments[4][80][0].apply(r,arguments)},{dup:80}],98:[function(e,t,r){arguments[4][81][0].apply(r,arguments)},{"./_stream_readable":100,"./_stream_writable":102,_process:49,"core-util-is":103,dup:81,inherits:129}],99:[function(e,t,r){arguments[4][82][0].apply(r,arguments)},{"./_stream_transform":101,"core-util-is":103,dup:82,inherits:129}],100:[function(e,t,r){arguments[4][83][0].apply(r,arguments)},{"./_stream_duplex":98,_process:49,buffer:39,"core-util-is":103,dup:83,events:43,inherits:129,isarray:104,stream:67,"string_decoder/":105,util:38}],101:[function(e,t,r){arguments[4][84][0].apply(r,arguments)},{"./_stream_duplex":98,"core-util-is":103,dup:84,inherits:129}],102:[function(e,t,r){arguments[4][85][0].apply(r,arguments)},{"./_stream_duplex":98,_process:49,buffer:39,"core-util-is":103,dup:85,inherits:129,stream:67}],103:[function(e,t,r){arguments[4][60][0].apply(r,arguments)},{"/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":45,dup:60}],104:[function(e,t,r){arguments[4][46][0].apply(r,arguments)},{dup:46}],105:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{buffer:39,dup:77}],106:[function(e,t,r){arguments[4][89][0].apply(r,arguments)},{"./lib/_stream_duplex.js":98,"./lib/_stream_passthrough.js":99,"./lib/_stream_readable.js":100,"./lib/_stream_transform.js":101,"./lib/_stream_writable.js":102,dup:89,stream:67}],107:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:108,dup:19,wrappy:110}],108:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":109,dup:20}],109:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],110:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],111:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":112}],112:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],113:[function(e,t,r){var i=e("stream").Readable;var n=e("inherits");var a=/^.*\.(\w+)$/;var s=e("typedarray-to-buffer");function o(e,t){var r=this;if(!(this instanceof o)){return new o(e,t)}t=t||{};i.call(this,t);this._offset=0;this._ready=false;this._file=e;this._size=e.size;this._chunkSize=t.chunkSize||Math.max(this._size/1e3,200*1024);this.reader=new FileReader;this._generateHeaderBlocks(e,t,function(e,t){if(e){return r.emit("error",e)}if(Array.isArray(t)){t.forEach(function(e){r.push(e)})}r._ready=true;r.emit("_ready")})}n(o,i);t.exports=o;o.prototype._generateHeaderBlocks=function(e,t,r){r(null,[])};o.prototype._read=function(){if(!this._ready){this.once("_ready",this._read.bind(this));return}var e=this;var t=this.reader;var r=this._offset;var i=this._offset+this._chunkSize;if(i>this._size)i=this._size;if(r===this._size){this.destroy();this.push(null); +return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function(){e.emit("error",t.error)};t.readAsArrayBuffer(this._file.slice(r,i))};o.prototype.destroy=function(){this._file=null;if(this.reader){this.reader.onload=null;this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}},{inherits:129,stream:67,"typedarray-to-buffer":111}],114:[function(e,t,r){t.exports=function i(e,t){t=typeof t=="number"?t:Infinity;return r(e,1);function r(e,i){return e.reduce(function(e,n){if(Array.isArray(n)&&i=r){break}r=i;n=t[a]}return n}},{}],121:[function(e,t,r){r=t.exports=e("./debug");r.log=a;r.formatArgs=n;r.save=s;r.load=o;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:f();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){return JSON.stringify(e)};function n(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0;var a=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;n++;if("%c"===e){a=n}});e.splice(a,0,i);return e}function a(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function o(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(o());function f(){try{return window.localStorage}catch(e){}}},{"./debug":122}],122:[function(e,t,r){r=t.exports=s;r.coerce=l;r.disable=f;r.enable=o;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var i=0;var n;function a(){return r.colors[i++%r.colors.length]}function s(e){function t(){}t.enabled=false;function i(){var e=i;var t=+new Date;var s=t-(n||t);e.diff=s;e.prev=n;e.curr=t;n=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=a();var o=Array.prototype.slice.call(arguments);o[0]=r.coerce(o[0]);if("string"!==typeof o[0]){o=["%o"].concat(o)}var f=0;o[0]=o[0].replace(/%([a-z%])/g,function(t,i){if(t==="%%")return t;f++;var n=r.formatters[i];if("function"===typeof n){var a=o[f];t=n.call(e,a);o.splice(f,1);f--}return t});if("function"===typeof r.formatArgs){o=r.formatArgs.apply(e,o)}var u=i.log||r.log||console.log.bind(console);u.apply(e,o)}i.enabled=true;var s=r.enabled(e)?i:t;s.namespace=e;return s}function o(e){r.save(e);var t=(e||"").split(/[\s,]+/);var i=t.length;for(var n=0;n1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*o;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*a;case"minutes":case"minute":case"mins":case"min":case"m":return r*n;case"seconds":case"second":case"secs":case"sec":case"s":return r*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function u(e){if(e>=s)return Math.round(e/s)+"d";if(e>=a)return Math.round(e/a)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=i)return Math.round(e/i)+"s";return e+"ms"}function l(e){return c(e,s,"day")||c(e,a,"hour")||c(e,n,"minute")||c(e,i,"second")||e+" ms"}function c(e,t,r){if(e=Math.pow(2,e)){return i(e,t)}else return s};i.rack=function(e,t,r){var n=function(n){var s=0;do{if(s++>10){if(r)e+=r;else throw new Error("too many ID collisions, use more bits")}var o=i(e,t)}while(Object.hasOwnProperty.call(a,o));a[o]=n;return o};var a=n.hats={};n.get=function(e){return n.hats[e]};n.set=function(e,t){n.hats[e]=t;return n};n.bits=e||128;n.base=t||16;return n}},{}],128:[function(e,t,r){(function(e){t.exports=r;function r(e){if(!(this instanceof r))return new r(e);this.store=e;if(!this.store||!this.store.get||!this.store.put){throw new Error("First argument must be abstract-chunk-store compliant")}this.mem=[]}r.prototype.put=function(e,t,r){var i=this;i.mem[e]=t;i.store.put(e,t,function(t){i.mem[e]=null;if(r)r(t)})};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);var n=t&&t.offset||0;var a=t&&t.length&&n+t.length;var s=this.mem[e];if(s)return i(r,null,t?s.slice(n,a):s);this.store.get(e,t,r)};r.prototype.close=function(e){this.store.close(e)};r.prototype.destroy=function(e){this.store.destroy(e)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:49}],129:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function i(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},{}],130:[function(e,t,r){t.exports=s;var i=e("inherits");var n=e("stream");var a=typeof window!=="undefined"&&window.MediaSource;i(s,n.Writable);function s(e,t){var r=this;if(!(r instanceof s))return new s(e,t);n.Writable.call(r,t);if(!a)throw new Error("web browser lacks MediaSource support");if(!t)t={};r._elem=e;r._mediaSource=new a;r._sourceBuffer=null;r._cb=null;r._type=t.type||o(t.extname);if(!r._type)throw new Error("missing `opts.type` or `opts.extname` options");r._elem.src=window.URL.createObjectURL(r._mediaSource);r._mediaSource.addEventListener("sourceopen",function(){if(a.isTypeSupported(r._type)){r._sourceBuffer=r._mediaSource.addSourceBuffer(r._type);r._sourceBuffer.addEventListener("updateend",r._flow.bind(r));r._flow()}else{r._mediaSource.endOfStream("decode")}});r.on("finish",function(){r._mediaSource.endOfStream()})}s.prototype._write=function(e,t,r){var i=this;if(!i._sourceBuffer){i._cb=function(n){if(n)return r(n);i._write(e,t,r)};return}if(i._sourceBuffer.updating){return r(new Error("Cannot append buffer while source buffer updating"))}i._sourceBuffer.appendBuffer(e);i._cb=r};s.prototype._flow=function(){var e=this;if(e._cb){e._cb(null)}};function o(e){if(!e)return null;if(e[0]!==".")e="."+e;return{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[e]}},{inherits:129,stream:67}],131:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(!(this instanceof r))return new r(e,t);if(!t)t={};this.chunkLength=Number(e);if(!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[];this.closed=false;this.length=Number(t.length)||Infinity;if(this.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1}}r.prototype.put=function(e,t,r){if(this.closed)return i(r,new Error("Storage is closed"));var n=e===this.lastChunkIndex;if(n&&t.length!==this.lastChunkLength){return i(r,new Error("Last chunk length must be "+this.lastChunkLength))}if(!n&&t.length!==this.chunkLength){return i(r,new Error("Chunk length must be "+this.chunkLength))}this.chunks[e]=t;i(r,null)};r.prototype.get=function(e,t,r){if(typeof t==="function")return this.get(e,null,t);if(this.closed)return i(r,new Error("Storage is closed"));var n=this.chunks[e];if(!n)return i(r,new Error("Chunk not found"));if(!t)return i(r,null,n);var a=t.offset||0;var s=t.length||n.length-a;i(r,null,n.slice(a,s+a))};r.prototype.close=r.prototype.destroy=function(e){if(this.closed)return i(e,new Error("Storage is closed"));this.closed=true;this.chunks=null;i(e,null)};function i(t,r,i){e.nextTick(function(){if(t)t(r,i)})}}).call(this,e("_process"))},{_process:49}],132:[function(e,t,r){(function(r){var i=e("path");var n=e("fs");function a(){this.types=Object.create(null);this.extensions=Object.create(null)}a.prototype.define=function(e){for(var t in e){var i=e[t];for(var n=0;n=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":141,uniq:168,xtend:181}],141:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":142}],142:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],143:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":124,fs:37,once:151}],150:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],151:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:150}],152:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],153:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],154:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],155:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:156}],156:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:157,dup:19,wrappy:159}],157:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":158,dup:20}],158:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],159:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],160:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:68,https:44,once:162,"unzip-response":38,url:78,xtend:181}],161:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],162:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:161}],163:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:164}],164:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){ +var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:170,bitfield:9,buffer:39,events:43,inherits:129,"simple-sha1":163}],170:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":171,"./lib/encode":173,dup:15}],171:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":172,buffer:39,dup:16}],172:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],173:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],174:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],175:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){ +if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":178}],177:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){ +this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.1",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Sun, 4 Oct 2015 16:29:28 -0400 Subject: [PATCH 092/109] Use path.resolve in tests See https://github.com/feross/webtorrent/issues/429#issuecomment-139878312 --- test/basic-node.js | 9 +++++---- test/basic.js | 5 +++-- test/blocklist-dht.js | 3 ++- test/blocklist-tracker.js | 3 ++- test/blocklist.js | 7 ++++--- test/cmd.js | 9 +++++---- test/download-dht-magnet.js | 5 +++-- test/download-dht-torrent.js | 5 +++-- test/download-private-dht.js | 5 +++-- test/download-tracker-magnet.js | 5 +++-- test/download-tracker-torrent.js | 5 +++-- test/download-webseed-magnet.js | 4 ++-- test/download-webseed-torrent.js | 4 ++-- test/duplicates.js | 3 ++- test/extensions.js | 3 ++- test/metadata.js | 3 ++- test/multiple.js | 3 ++- test/server.js | 5 +++-- 18 files changed, 51 insertions(+), 35 deletions(-) diff --git a/test/basic-node.js b/test/basic-node.js index 494dace3..cc093eca 100644 --- a/test/basic-node.js +++ b/test/basic-node.js @@ -1,16 +1,17 @@ var WebTorrent = require('../') var fs = require('fs') var http = require('http') +var path = require('path') var parseTorrent = require('parse-torrent') var test = require('tape') -var leavesPath = __dirname + '/torrents/leaves.torrent' +var leavesPath = path.resolve(__dirname, 'torrents', 'leaves.torrent') var leaves = fs.readFileSync(leavesPath) var leavesTorrent = parseTorrent(leaves) -var leavesBookPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesBookPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') var leavesMagnetURI = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=http%3A%2F%2Ftracker.bittorrent.am%2Fannounce&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ffr33domtracker.h33t.com%3A3310%2Fannounce&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80' -var numbersPath = __dirname + '/content/numbers' -var folderPath = __dirname + '/content/folder' +var numbersPath = path.resolve(__dirname, 'content', 'numbers') +var folderPath = path.resolve(__dirname, 'content', 'folder') test('client.add: http url to a torrent file, string', function (t) { t.plan(3) diff --git a/test/basic.js b/test/basic.js index 28988c09..4fedcb88 100644 --- a/test/basic.js +++ b/test/basic.js @@ -1,12 +1,13 @@ +var path = require('path') var fs = require('fs') var extend = require('xtend') var parseTorrent = require('parse-torrent') var test = require('tape') var WebTorrent = require('../') -var leaves = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leaves = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesTorrent = parseTorrent(leaves) -var leavesBook = fs.readFileSync(__dirname + '/content/Leaves of Grass by Walt Whitman.epub') +var leavesBook = fs.readFileSync(path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub')) var leavesMagnetURI = 'magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=http%3A%2F%2Ftracker.bittorrent.am%2Fannounce&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ffr33domtracker.h33t.com%3A3310%2Fannounce&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80' diff --git a/test/blocklist-dht.js b/test/blocklist-dht.js index 113d9afc..60ec4fd7 100644 --- a/test/blocklist-dht.js +++ b/test/blocklist-dht.js @@ -1,12 +1,13 @@ var auto = require('run-auto') var DHT = require('bittorrent-dht/server') +var path = require('path') var fs = require('fs') var networkAddress = require('network-address') var parseTorrent = require('parse-torrent') var test = require('tape') var WebTorrent = require('../') -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) // remove trackers from .torrent file diff --git a/test/blocklist-tracker.js b/test/blocklist-tracker.js index cac256e8..1db8415f 100644 --- a/test/blocklist-tracker.js +++ b/test/blocklist-tracker.js @@ -1,11 +1,12 @@ var auto = require('run-auto') +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') var TrackerServer = require('bittorrent-tracker/server') var WebTorrent = require('../') -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) test('blocklist blocks peers discovered via tracker', function (t) { diff --git a/test/blocklist.js b/test/blocklist.js index 6c646182..73ec8156 100644 --- a/test/blocklist.js +++ b/test/blocklist.js @@ -1,3 +1,4 @@ +var path = require('path') var fs = require('fs') var http = require('http') var parseTorrent = require('parse-torrent') @@ -5,10 +6,10 @@ var test = require('tape') var WebTorrent = require('../') var zlib = require('zlib') -var blocklistPath = __dirname + '/content/blocklist.txt' -var blocklistGzipPath = __dirname + '/content/blocklist.txt.gz' +var blocklistPath = path.resolve(__dirname, 'content', 'blocklist.txt') +var blocklistGzipPath = path.resolve(__dirname, 'content', 'blocklist.txt.gz') -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) // remove trackers from .torrent file diff --git a/test/cmd.js b/test/cmd.js index c937a6bc..686d0132 100644 --- a/test/cmd.js +++ b/test/cmd.js @@ -1,9 +1,10 @@ var cp = require('child_process') +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') -var CMD = __dirname + '/../bin/cmd.js' +var CMD = path.resolve(__dirname, '..', 'bin', 'cmd.js') test('Command line: webtorrent help', function (t) { t.plan(6) @@ -26,7 +27,7 @@ test('Command line: webtorrent help', function (t) { test('Command line: webtorrent version', function (t) { t.plan(6) - var expectedVersion = require(__dirname + '/../package.json').version + '\n' + var expectedVersion = require(path.resolve(__dirname, '..', 'package.json')).version + '\n' cp.exec(CMD + ' version', function (err, data) { t.error(err) @@ -47,7 +48,7 @@ test('Command line: webtorrent version', function (t) { test('Command line: webtorrent info /path/to/file.torrent', function (t) { t.plan(3) - var leavesPath = __dirname + '/torrents/leaves.torrent' + var leavesPath = path.resolve(__dirname, 'torrents', 'leaves.torrent') var leaves = fs.readFileSync(leavesPath) cp.exec(CMD + ' info ' + leavesPath, function (err, data) { @@ -80,7 +81,7 @@ test('Command line: webtorrent info magnet_uri', function (t) { test('Command line: webtorrent create /path/to/file', function (t) { t.plan(1) - var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' + var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') var child = cp.spawn(CMD, [ 'create', leavesPath ]) child.on('error', function (err) { t.fail(err) }) diff --git a/test/download-dht-magnet.js b/test/download-dht-magnet.js index 34656e20..cdd99acb 100644 --- a/test/download-dht-magnet.js +++ b/test/download-dht-magnet.js @@ -1,13 +1,14 @@ var auto = require('run-auto') var DHT = require('bittorrent-dht/server') +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') var WebTorrent = require('../') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') var leavesFile = fs.readFileSync(leavesPath) -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) // remove trackers from .torrent file diff --git a/test/download-dht-torrent.js b/test/download-dht-torrent.js index 408b0606..19e8b563 100644 --- a/test/download-dht-torrent.js +++ b/test/download-dht-torrent.js @@ -1,13 +1,14 @@ var auto = require('run-auto') var DHT = require('bittorrent-dht/server') +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') var WebTorrent = require('../') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') var leavesFile = fs.readFileSync(leavesPath) -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) // remove trackers from .torrent file diff --git a/test/download-private-dht.js b/test/download-private-dht.js index ca24cd7a..56537556 100644 --- a/test/download-private-dht.js +++ b/test/download-private-dht.js @@ -1,14 +1,15 @@ var auto = require('run-auto') var DHT = require('bittorrent-dht/server') +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') var WebTorrent = require('../') -var bunnyTorrent = fs.readFileSync(__dirname + '/torrents/big-buck-bunny-private.torrent') +var bunnyTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'big-buck-bunny-private.torrent')) var bunnyParsed = parseTorrent(bunnyTorrent) -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) // remove trackers from .torrent file diff --git a/test/download-tracker-magnet.js b/test/download-tracker-magnet.js index 0aac1fb8..445c23c8 100644 --- a/test/download-tracker-magnet.js +++ b/test/download-tracker-magnet.js @@ -1,13 +1,14 @@ var auto = require('run-auto') +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') var TrackerServer = require('bittorrent-tracker/server') var WebTorrent = require('../') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') var leavesFile = fs.readFileSync(leavesPath) -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) test('Download using UDP tracker (via magnet uri)', function (t) { diff --git a/test/download-tracker-torrent.js b/test/download-tracker-torrent.js index 909fcaa6..438450ac 100644 --- a/test/download-tracker-torrent.js +++ b/test/download-tracker-torrent.js @@ -1,13 +1,14 @@ var auto = require('run-auto') +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') var TrackerServer = require('bittorrent-tracker/server') var WebTorrent = require('../') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') var leavesFile = fs.readFileSync(leavesPath) -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) test('Download using UDP tracker (via .torrent file)', function (t) { diff --git a/test/download-webseed-magnet.js b/test/download-webseed-magnet.js index 97ec256f..ca11b0f3 100644 --- a/test/download-webseed-magnet.js +++ b/test/download-webseed-magnet.js @@ -8,10 +8,10 @@ var serveStatic = require('serve-static') var test = require('tape') var WebTorrent = require('../') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') var leavesFilename = 'Leaves of Grass by Walt Whitman.epub' var leavesFile = fs.readFileSync(leavesPath) -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) // remove trackers from .torrent file diff --git a/test/download-webseed-torrent.js b/test/download-webseed-torrent.js index e9f8bd14..3a5c1972 100644 --- a/test/download-webseed-torrent.js +++ b/test/download-webseed-torrent.js @@ -9,10 +9,10 @@ var serveStatic = require('serve-static') var finalhandler = require('finalhandler') var path = require('path') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') var leavesFilename = 'Leaves of Grass by Walt Whitman.epub' var leavesFile = fs.readFileSync(leavesPath) -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesParsed = parseTorrent(leavesTorrent) // remove trackers from .torrent file diff --git a/test/duplicates.js b/test/duplicates.js index c033d2a0..6c1cbc95 100644 --- a/test/duplicates.js +++ b/test/duplicates.js @@ -1,8 +1,9 @@ +var path = require('path') var fs = require('fs') var test = require('tape') var WebTorrent = require('../') -var leavesBook = fs.readFileSync(__dirname + '/content/Leaves of Grass by Walt Whitman.epub') +var leavesBook = fs.readFileSync(path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub')) test('client.seed followed by duplicate client.add', function (t) { t.plan(3) diff --git a/test/extensions.js b/test/extensions.js index ba5e2040..14ea63b1 100644 --- a/test/extensions.js +++ b/test/extensions.js @@ -1,9 +1,10 @@ +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') var WebTorrent = require('../') -var leaves = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leaves = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesTorrent = parseTorrent(leaves) test('extension support', function (t) { diff --git a/test/metadata.js b/test/metadata.js index fe2ee0c2..eb205f3e 100644 --- a/test/metadata.js +++ b/test/metadata.js @@ -1,9 +1,10 @@ +var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') var WebTorrent = require('../') -var leaves = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leaves = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) var leavesTorrent = parseTorrent(leaves) test('ut_metadata transfer', function (t) { diff --git a/test/multiple.js b/test/multiple.js index 4fb5673d..f843bf7a 100644 --- a/test/multiple.js +++ b/test/multiple.js @@ -1,10 +1,11 @@ /* +var path = require('path') var fs = require('fs') var test = require('tape') var WebTorrent = require('../') var torrents = [ 'leaves', 'pride' ].map(function (name) { - return fs.readFileSync(__dirname + '/torrents/' + name + '.torrent') + return fs.readFileSync(path.resolve(__dirname, 'torrents', name + '.torrent')) }) // TODO: replace this with a test that can run offline diff --git a/test/server.js b/test/server.js index eed4157c..dfa1730c 100644 --- a/test/server.js +++ b/test/server.js @@ -1,10 +1,11 @@ +var path = require('path') var fs = require('fs') var get = require('simple-get') var test = require('tape') var WebTorrent = require('../') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' -var leavesTorrent = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') +var leavesTorrent = fs.readFileSync(path.resolve(__dirname, 'torrents', 'leaves.torrent')) test('start http server programmatically', function (t) { t.plan(4) From c3a201dc48f192bf4fda9b60b7c20d8d7b557b2e Mon Sep 17 00:00:00 2001 From: Joseph Frazier Date: Sun, 4 Oct 2015 16:56:13 -0400 Subject: [PATCH 093/109] exec/spawn cmd.js with 'node' See https://github.com/feross/webtorrent/issues/429#issuecomment-139878312 > This is because a windows system doesn't use the shebang so it might > not know how to execute a js file. Spawning using node and node will > understand how to read this. --- test/cmd.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cmd.js b/test/cmd.js index 686d0132..abba4c26 100644 --- a/test/cmd.js +++ b/test/cmd.js @@ -4,7 +4,8 @@ var fs = require('fs') var parseTorrent = require('parse-torrent') var test = require('tape') -var CMD = path.resolve(__dirname, '..', 'bin', 'cmd.js') +var CMD_PATH = path.resolve(__dirname, '..', 'bin', 'cmd.js') +var CMD = 'node ' + CMD_PATH test('Command line: webtorrent help', function (t) { t.plan(6) @@ -83,7 +84,7 @@ test('Command line: webtorrent create /path/to/file', function (t) { var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') - var child = cp.spawn(CMD, [ 'create', leavesPath ]) + var child = cp.spawn('node', [ CMD_PATH, 'create', leavesPath ]) child.on('error', function (err) { t.fail(err) }) var chunks = [] From b8636e260aae5500f25bce211d8d691714c97234 Mon Sep 17 00:00:00 2001 From: Joseph Frazier Date: Sun, 4 Oct 2015 17:24:03 -0400 Subject: [PATCH 094/109] travis: cache node_modules for faster builds http://blog.travis-ci.com/2013-12-05-speed-up-your-builds-cache-your-dependencies/ --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index bfae080b..904e52ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,3 +6,6 @@ env: global: - secure: AJsEWFnWC5W8hcF3hJzm3PT7heazJpKg85xiSvIWVzLHZU/s0h4+WfJ6t0F9v3L4awaowm62vy8CRaxRkB4lJyJg+JK2K0QN7lNFGj2f8Jx2cFlVJ1IyY959GY4iUg66JrNj1yzS02+yQfweDngyifqzb7IlxnowiveDjUO2gyo= - secure: hvihwLUqlPchrGFXKWFF7iKRugISU7r/gLBo6O63nPeg0OwnYqYcC2BnBWoSiOdu9oR5bM4a5u0os04XL+bP3dqt324g0uBTqvyyxD6NhBsphVFkUmdUH3HMe7IQY6JTns96KT/6UkQapKhIuW4CUDeidR+5NFKvyRdKIjSawS4= +cache: + directories: + - node_modules From 12c6a2a7f9ac302543ce1ec13b8eaaae89b309da Mon Sep 17 00:00:00 2001 From: Yousef Amar Date: Mon, 5 Oct 2015 21:23:35 +0200 Subject: [PATCH 095/109] Accommodate Chrome/FF optional Blob arg difference The specs say that the second Blob constructor argument is optional (http://www.w3.org/TR/FileAPI/#constructorParams), however Chrome and FF implement that differently. FF checks if the second arg is not undefined, while Chrome checks "arguments.length". As a result, if the second argument is undefined, Chrome will throw an error (https://chromium.googlesource.com/chromium/blink/+/72fef91ac1ef679207f51def8133b336a6f6588f/LayoutTests/fast/files/blob-constructor.html#55), while FF will just ignore it. This change makes it so that the second arg is not passed at all when it's undefined, and Chrome is happy as a result. --- lib/file.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/file.js b/lib/file.js index 51490471..340ff37f 100644 --- a/lib/file.js +++ b/lib/file.js @@ -114,7 +114,7 @@ File.prototype.getBlobURL = function (cb) { if (err) return cb(err) var ext = path.extname(self.name).toLowerCase() var type = mime[ext] - var blob = new window.Blob([ buffer ], type && { type: type }) + var blob = type ? new window.Blob([ buffer ], { type: type }) : new window.Blob([ buffer ]) var url = window.URL.createObjectURL(blob) cb(null, url) }) From aa31d70c0cdc8136b63056083e449d68d37bc8bd Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 5 Oct 2015 13:04:52 -0700 Subject: [PATCH 096/109] 0.62.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2eae70e4..a14cf99b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.62.1", + "version": "0.62.2", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From dda5c601e3b939e6f010b295120e33ce3c72c434 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 5 Oct 2015 13:06:23 -0700 Subject: [PATCH 097/109] build --- webtorrent.min.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 71d93dd5..076a5b7f 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -1,4 +1,4 @@ -(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.WebTorrent=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,o){if(!t[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!o&&f)return f(s,!0);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return i(r?r:t)},l,l.exports,n,e,t,r)}return t[s].exports}var a=typeof require=="function"&&require;for(var s=0;s=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null,u)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null,u)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:49,debug:121,mediasource:130,path:48,videostream:180}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:121,http:68,mime:132,pump:149,"range-parser":153,url:78}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var T=e("ut_metadata");var I=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r.path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;var r=t._selections.length;while(r--){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:49,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":90,"create-torrent":91,debug:121,events:43,"fs-chunk-store":131,"immediate-chunk-store":128,inherits:129,multistream:134,os:47,"parse-torrent":135,path:48,"path-exists":148,pump:149,"random-iterate":152,"re-emitter":154,"run-parallel":155,"simple-sha1":163,"torrent-discovery":166,"torrent-piece":167,uniq:168,ut_metadata:169,ut_pex:38,"xtend/mutable":182}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)t.exports.reset();if(!n[e]){var r=i.exec(e);if(!r)throw new Error("invalid addr: "+e);n[e]=[r[1],Number(r[2])];a+=1}return n[e]};t.exports.reset=function o(){n={};a=0}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=0)_();else if(c.indexOf(g)>=0)w();else if(p.indexOf(g)>=0)x();else if(d.indexOf(g)>=0)k();else v(r,new Error('Unsupported file type "'+g+'": Cannot append to DOM'));function _(){if(!h){return v(r,new Error("Video/audio streaming is not supported in your browser. You can still share "+"or download "+e.name+" (once it's fully downloaded). Use Chrome for "+"MediaSource support."))}var a=f.indexOf(g)>=0?"video":"audio";if(o.indexOf(g)>=0)l();else c();function l(){i("Use `videostream` package for "+e.name);_();u.addEventListener("error",d);u.addEventListener("playing",b);s(e,u)}function c(){i("Use MediaSource API for "+e.name);_();u.addEventListener("error",m);u.addEventListener("playing",b);e.createReadStream().pipe(new n(u,{extname:g}));if(y)u.currentTime=y}function p(){i("Use Blob URL for "+e.name);_();u.addEventListener("error",S);u.addEventListener("playing",b);e.getBlobURL(function(e,t){if(e)return S(e);u.src=t;if(y)u.currentTime=y})}function d(e){i("videostream error: fallback to MediaSource API: %o",e.message||e);u.removeEventListener("error",d);u.removeEventListener("playing",b);c()}function m(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e);u.removeEventListener("error",m);u.removeEventListener("playing",b);p()}function _(e){if(!u){u=document.createElement(a);u.controls=true;u.autoplay=true;u.play();u.addEventListener("progress",function(){y=u.currentTime});t.appendChild(u)}}}function b(){u.removeEventListener("playing",b);r(null,u)}function w(){u=document.createElement("audio");u.controls=true;u.autoplay=true;t.appendChild(u);e.getBlobURL(function(e,t){if(e)return S(e);u.addEventListener("error",S);u.addEventListener("playing",b);u.src=t;u.play()})}function x(){e.getBlobURL(function(i,n){if(i)return S(i);u=document.createElement("img");u.src=n;u.alt=e.name;t.appendChild(u);r(null,u)})}function k(){e.getBlobURL(function(e,i){if(e)return S(e);u=document.createElement("iframe");u.src=i;if(g!==".pdf")u.sandbox="allow-forms allow-scripts";t.appendChild(u);r(null,u)})}function S(t){if(u)u.remove();t.message='Error appending file "'+e.name+'" to DOM: '+t.message;i(t.message);if(r)r(t)}};function m(){}function v(e,t,i){r.nextTick(function(){if(e)e(t,i)})}}).call(this,e("_process"))},{_process:49,debug:121,mediasource:130,path:48,videostream:180}],2:[function(e,t,r){t.exports=s;var i=e("debug")("webtorrent:file-stream");var n=e("inherits");var a=e("stream");n(s,a.Readable);function s(e,t){a.Readable.call(this,t);this.destroyed=false;this._torrent=e._torrent;var r=t&&t.start||0;var i=t&&t.end||e.length-1;var n=e._torrent.pieceLength;this._startPiece=(r+e.offset)/n|0;this._endPiece=(i+e.offset)/n|0;this._piece=this._startPiece;this._offset=r+e.offset-this._startPiece*n;this._missing=i-r+1;this._reading=false;this._notifying=false;this._criticalLength=Math.min(1024*1024/n|0,2)}s.prototype._read=function(){if(this._reading)return;this._reading=true;this._notify()};s.prototype._notify=function(){var e=this;if(!e._reading||e._missing===0)return;if(!e._torrent.bitfield.get(e._piece)){return e._torrent.critical(e._piece,e._piece+e._criticalLength)}if(e._notifying)return;e._notifying=true;var t=e._piece;e._torrent.store.get(t,function(r,n){e._notifying=false;if(e.destroyed)return;if(r)return e.destroy(r);i("read %s (length %s) (err %s)",t,n.length,r&&r.message);if(e._offset){n=n.slice(e._offset);e._offset=0}if(e._missing0){return r[Math.random()*r.length|0]}else{return-1}}},{}],6:[function(e,t,r){t.exports=u;var i=e("debug")("webtorrent:server");var n=e("http");var a=e("mime");var s=e("pump");var o=e("range-parser");var f=e("url");function u(e,t){var r=n.createServer(t);var u=[];r.on("connection",function(e){e.setTimeout(36e6);u.push(e);e.on("close",function(){var t=u.indexOf(e);if(t>=0)u.splice(t,1)})});r.destroy=function(e){u.forEach(function(e){e.destroy()});r.close(e)};r.on("request",function(t,r){i("onRequest");if(t.method==="OPTIONS"&&t.headers["access-control-request-headers"]){r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS");r.setHeader("Access-Control-Allow-Headers",t.headers["access-control-request-headers"]);r.setHeader("Access-Control-Max-Age","1728000");return r.end()}if(t.headers.origin){r.setHeader("Access-Control-Allow-Origin",t.headers.origin)}var n=f.parse(t.url).pathname;if(n==="/favicon.ico")return r.end();if(e.ready)u();else e.once("ready",u);function u(){if(n==="/"){r.setHeader("Content-Type","text/html");var f=e.files.map(function(e,t){return'
  • '+e.name+"
  • "}).join("
    ");return r.end("

    WebTorrent

      "+f+"
    ")}var u=Number(n.slice(1));if(Number.isNaN(u)||u>=e.files.length){r.statusCode=404;return r.end("404 Not Found")}var l=e.files[u];r.setHeader("Accept-Ranges","bytes");r.setHeader("Content-Type",a.lookup(l.name));r.statusCode=200;r.setHeader("transferMode.dlna.org","Streaming");r.setHeader("contentFeatures.dlna.org","DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000");var c;if(t.headers.range){r.statusCode=206;c=o(l.length,t.headers.range)[0];i("range %s",JSON.stringify(c));r.setHeader("Content-Range","bytes "+c.start+"-"+c.end+"/"+l.length);r.setHeader("Content-Length",c.end-c.start+1)}else{r.setHeader("Content-Length",l.length)}if(t.method==="HEAD")r.end();s(l.createReadStream(c),r)}});return r}},{debug:121,http:68,mime:132,pump:149,"range-parser":153,url:78}],7:[function(e,t,r){(function(r,i){t.exports=H;var n=e("addr-to-ip-port");var a=e("bitfield");var s=e("chunk-store-stream/write");var o=e("create-torrent");var f=e("debug")("webtorrent:torrent");var u=e("torrent-discovery");var l=e("events").EventEmitter;var c=e("xtend/mutable");var p=e("fs-chunk-store");var d=e("immediate-chunk-store");var h=e("inherits");var m=e("multistream");var v=e("os");var g=e("run-parallel");var y=e("parse-torrent");var _=e("path");var b=e("path-exists");var w=e("torrent-piece");var x=e("pump");var k=e("random-iterate");var S=e("re-emitter");var E=e("simple-sha1");var A=e("bittorrent-swarm");var U=e("uniq");var T=e("ut_metadata");var I=e("ut_pex");var L=e("./file");var B=e("./rarity-map");var C=e("./server");var R=128*1024;var P=3e4;var z=5e3;var O=3*w.BLOCK_LENGTH;var F=.5;var M=1;var j=1e4;var D=2;var N=_.join(b.sync("/tmp")?"/tmp":v.tmpDir(),"webtorrent");h(H,l);function H(e,t){var r=this;l.call(r);if(!f.enabled)r.setMaxListeners(0);f("new torrent");r.client=t.client;r.announce=t.announce;r.urlList=t.urlList;r.path=t.path;r._store=t.store||p;r.strategy=t.strategy||"sequential";r._rechokeNumSlots=t.uploads===false||t.uploads===0?0:+t.uploads||10;r._rechokeOptimisticWire=null;r._rechokeOptimisticTime=0;r._rechokeIntervalId=null;r.ready=false;r.destroyed=false;r.metadata=null;r.store=null;r.numBlockedPeers=0;r.files=null;r.done=false;r._amInterested=false;r._selections=[];r._critical=[];r._servers=[];if(e)r._onTorrentId(e)}Object.defineProperty(H.prototype,"timeRemaining",{get:function(){if(this.swarm.downloadSpeed()===0)return Infinity;else return(this.length-this.downloaded)/this.swarm.downloadSpeed()*1e3}});Object.defineProperty(H.prototype,"downloaded",{get:function(){var e=0;for(var t=0,r=this.pieces.length;tt||e<0||t>=n.pieces.length){throw new Error("invalid selection ",e,":",t)}r=Number(r)||0;f("select %s-%s (priority %s)",e,t,r);n._selections.push({from:e,to:t,offset:0,priority:r,notify:i||W});n._selections.sort(function(e,t){return t.priority-e.priority});n._updateSelections()};H.prototype.deselect=function(e,t,r){var i=this;r=Number(r)||0;f("deselect %s-%s (priority %s)",e,t,r);for(var n=0;n2*(t.swarm.numConns-t.swarm.numPeers)&&e.amInterested){e.destroy()}else{r=setTimeout(i,z);if(r.unref)r.unref()}}var n=0;function a(){if(e.peerPieces.length!==t.pieces.length)return;for(;nR){return e.destroy()}if(t.pieces[r])return;t.store.get(r,{offset:i,length:n},a)});e.bitfield(t.bitfield);e.interested();r=setTimeout(i,z);if(r.unref)r.unref();e.isSeeder=false;a()};H.prototype._updateSelections=function(){var e=this;if(!e.swarm||e.destroyed)return;if(!e.metadata)return e.once("metadata",e._updateSelections.bind(e));r.nextTick(e._gcSelections.bind(e));e._updateInterest();e._update()};H.prototype._gcSelections=function(){var e=this;for(var t=0;t=r)return;var i=q(e,M);f(false)||f(true);function n(t,r,i,n){return function(a){return a>=t&&a<=r&&!(a in i)&&e.peerPieces.get(a)&&(!n||n(a))}}function a(){if(e.requests.length)return;var r=t._selections.length;while(r--){var i=t._selections[r];var a;if(t.strategy==="rarest"){var s=i.from+i.offset;var o=i.to;var f=o-s+1;var u={};var l=0;var c=n(s,o,u);while(l=i.from+i.offset;--a){if(!e.peerPieces.get(a))continue;if(t._request(e,a,false))return}}}}function s(){var r=e.downloadSpeed()||1;if(r>O)return function(){return true};var i=Math.max(1,e.requests.length)*w.BLOCK_LENGTH/r;var n=10;var a=0;return function(e){if(!n||t.bitfield.get(e))return true;var s=t.pieces[e].missing;for(;a0)continue;n--;return false}return true}}function o(e){var r=e;for(var i=e;i=i)return true;var a=s();for(var f=0;f0)e._rechokeOptimisticTime-=1;else e._rechokeOptimisticWire=null;var t=[];e.swarm.wires.forEach(function(r){if(!r.isSeeder&&r!==e._rechokeOptimisticWire){t.push({wire:r,downloadSpeed:r.downloadSpeed(),uploadSpeed:r.uploadSpeed(),salt:Math.random(),isChoked:true})}});t.sort(s);var r=0;var i=0;for(;i=O)continue;if(2*u>i||u>a)continue;s=f;a=u}if(!s)return false;for(o=0;o=s)return false;var o=n.pieces[t];var u=o.reserve();if(u===-1&&i&&n._hotswap(e,t)){u=o.reserve()}if(u===-1)return false;var l=n._reservations[t];if(!l)l=n._reservations[t]=[];var c=l.indexOf(null);if(c===-1)c=l.length;l[c]=e;var p=o.chunkOffset(u);var d=o.chunkLength(u);e.request(t,p,d,function m(r,i){if(!n.ready)return n.once("ready",function(){m(r,i)});if(l[c]===e)l[c]=null;if(o!==n.pieces[t])return h();if(r){f("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,e.remoteAddress+":"+e.remotePort,r.message);o.cancel(u);h();return}f("got piece %s (offset: %s length: %s) from %s",t,p,d,e.remoteAddress+":"+e.remotePort);if(!o.set(u,i,e))return h();var a=o.flush();E(a,function(e){if(e===n._hashes[t]){if(!n.pieces[t])return;f("piece verified %s",t);n.pieces[t]=null;n._reservations[t]=null;n.bitfield.set(t,true);n.store.put(t,a);n.swarm.wires.forEach(function(e){e.have(t)});n._checkDone()}else{n.pieces[t]=new w(o.length);n.emit("warning",new Error("Piece "+t+" failed verification"))}h()})});function h(){r.nextTick(function(){n._update()})}return true};H.prototype._checkDone=function(){var e=this;if(e.destroyed)return;e.files.forEach(function(t){if(t.done)return;for(var r=t._startPiece;r<=t._endPiece;++r){if(!e.bitfield.get(r))return}t.done=true;t.emit("done");f("file done: "+t.name)});if(e.files.every(function(e){return e.done})){e.done=true;e.emit("done");f("torrent done: "+e.infoHash);if(e.discovery.tracker)e.discovery.tracker.complete()}e._gcSelections()};H.prototype.load=function(e,t){var r=this;if(!Array.isArray(e))e=[e];if(!t)t=W;var i=new m(e);var n=new s(r.store,r.pieceLength);x(i,n,function(e){if(e)return t(e);r.pieces.forEach(function(e,t){r.pieces[t]=null;r._reservations[t]=null;r.bitfield.set(t,true)});r._checkDone();t(null)})};H.prototype.createServer=function(e){var t=this;if(typeof C!=="function")return;var r=new C(t,e);t._servers.push(r);return r};H.prototype._onError=function(e){var t=this;f("torrent error: %s",e.message||e);t.emit("error",e);t.destroy()};function q(e,t){return Math.ceil(2+t*e.downloadSpeed()/w.BLOCK_LENGTH)}function G(e){return Math.random()*e|0}function W(){}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./file":3,"./rarity-map":5,"./server":6,_process:49,"addr-to-ip-port":8,bitfield:9,"bittorrent-swarm":10,"chunk-store-stream/write":90,"create-torrent":91,debug:121,events:43,"fs-chunk-store":131,"immediate-chunk-store":128,inherits:129,multistream:134,os:47,"parse-torrent":135,path:48,"path-exists":148,pump:149,"random-iterate":152,"re-emitter":154,"run-parallel":155,"simple-sha1":163,"torrent-discovery":166,"torrent-piece":167,uniq:168,ut_metadata:169,ut_pex:38,"xtend/mutable":182}],8:[function(e,t,r){var i=/^\[?([^\]]+)\]?:(\d+)$/;var n={};var a=0;t.exports=function s(e){if(a===1e5)t.exports.reset();if(!n[e]){var r=i.exec(e);if(!r)throw new Error("invalid addr: "+e);n[e]=[r[1],Number(r[2])];a+=1}return n[e]};t.exports.reset=function o(){n={};a=0}},{}],9:[function(e,t,r){(function(e){var r=typeof e!=="undefined"?e:typeof Int8Array!=="undefined"?Int8Array:function(e){var t=new Array(e);for(var r=0;r>3;if(e%8!==0)t++;return t}i.prototype.get=function(e){var t=e>>3;return t>e%8)};i.prototype.set=function(e,t){var r=e>>3;if(t||arguments.length===1){if(this.buffer.length>e%8}else if(r>e%8)}};i.prototype._grow=function(e){if(this.buffer.length=e.maxConns){return}a("drain (%s queued, %s/%s peers)",e.numQueued,e.numPeers,e.maxConns);var t=e._queue.shift();if(!t)return;a("tcp connect attempt to %s",t.addr);var r=n(t.addr);var i={host:r[0],port:r[1]};if(e._hostname)i.localAddress=e._hostname;var s=t.conn=u.connect(i);s.once("connect",function(){t.onConnect()});s.once("error",function(e){t.destroy(e)});t.setConnectTimeout();s.on("close",function(){if(e.destroyed)return;if(t.retries>=h.length){a("conn %s closed: will not re-add (max %s attempts)",t.addr,h.length);return}var r=h[t.retries];a("conn %s closed: will re-add to queue in %sms (attempt %s)",t.addr,r,t.retries+1);var i=setTimeout(function n(){var r=e._addPeer(t.addr);if(r)r.retries=t.retries+1},r);if(i.unref)i.unref()})};m.prototype._onError=function(e){var t=this;t.emit("error",e);t.destroy()};m.prototype._validAddr=function(e){var t=this;var r=n(e);var i=r[0];var a=r[1];return a>0&&a<65535&&!(i==="127.0.0.1"&&a===t._port)}}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/peer":11,"./lib/tcp-pool":12,_process:49,"addr-to-ip-port":38,buffer:39,debug:121,dezalgo:19,events:43,inherits:129,net:38,speedometer:165}],11:[function(e,t,r){var i=e("debug")("bittorrent-swarm:peer");var n=e("./webconn");var a=e("bittorrent-protocol");var s=25e3;var o=25e3;r.createWebRTCPeer=function(e,t){var r=new f(e.id);r.conn=e;r.swarm=t;if(r.conn.connected){r.onConnect()}else{r.conn.once("connect",function(){r.onConnect()});r.conn.once("error",function(e){r.destroy(e)});r.setConnectTimeout()}return r};r.createIncomingTCPPeer=function(e){var t=e.remoteAddress+":"+e.remotePort;var r=new f(t);r.conn=e;r.addr=t;r.onConnect();return r};r.createOutgoingTCPPeer=function(e,t){var r=new f(e);r.addr=e;r.swarm=t;return r};r.createWebPeer=function(e,t,r){var i=new f(e);i.swarm=r;i.conn=new n(e,t);i.onConnect();return i};function f(e){var t=this;t.id=e;i("new Peer %s",e);t.addr=null;t.conn=null;t.swarm=null;t.wire=null;t.connected=false;t.destroyed=false;t.timeout=null;t.retries=0;t.sentHandshake=false}f.prototype.onConnect=function(){var e=this;if(e.destroyed)return;e.connected=true;i("Peer %s connected",e.id);clearTimeout(e.connectTimeout);var t=e.conn;t.once("end",function(){e.destroy()});t.once("close",function(){e.destroy()});t.once("finish",function(){e.destroy()});t.once("error",function(t){e.destroy(t)});var r=e.wire=new a;r.once("end",function(){e.destroy()});r.once("close",function(){e.destroy()});r.once("finish",function(){e.destroy()});r.once("error",function(t){e.destroy(t)});r.once("handshake",function(t,r){e.onHandshake(t,r)});e.setHandshakeTimeout();t.pipe(r).pipe(t);if(e.swarm&&!e.sentHandshake)e.handshake()};f.prototype.onHandshake=function(e,t){var r=this;if(!r.swarm)return;var n=e.toString("hex");var a=t.toString("hex");if(r.swarm.destroyed)return r.destroy(new Error("swarm already destroyed"));if(n!==r.swarm.infoHashHex){return r.destroy(new Error("unexpected handshake info hash for this swarm"))}if(a===r.swarm.peerIdHex){return r.destroy(new Error("refusing to handshake with self"))}i("Peer %s got handshake %s",r.id,n);clearTimeout(r.handshakeTimeout);r.retries=0;r.wire.on("download",function(e){if(r.destroyed)return;r.swarm.downloaded+=e;r.swarm.downloadSpeed(e);r.swarm.emit("download",e)});r.wire.on("upload",function(e){if(r.destroyed)return;r.swarm.uploaded+=e;r.swarm.uploadSpeed(e);r.swarm.emit("upload",e)});if(!r.sentHandshake)r.handshake();r.swarm.wires.push(r.wire);var s=r.addr;if(!s&&r.conn.remoteAddress){s=r.conn.remoteAddress+":"+r.conn.remotePort}r.swarm.emit("wire",r.wire,s)};f.prototype.handshake=function(){var e=this;e.wire.handshake(e.swarm.infoHash,e.swarm.peerId,e.swarm.handshakeOpts);e.sentHandshake=true};f.prototype.setConnectTimeout=function(){var e=this;clearTimeout(e.connectTimeout);e.connectTimeout=setTimeout(function(){e.destroy(new Error("connect timeout"))},s);if(e.connectTimeout.unref)e.connectTimeout.unref()};f.prototype.setHandshakeTimeout=function(){var e=this;clearTimeout(e.handshakeTimeout);e.handshakeTimeout=setTimeout(function(){e.destroy(new Error("handshake timeout"))},o);if(e.handshakeTimeout.unref)e.handshakeTimeout.unref()};f.prototype.destroy=function(e){var t=this;if(t.destroyed)return;t.destroyed=true;t.connected=false;i("destroy %s (error: %s)",t.id,e&&(e.message||e));clearTimeout(t.connectTimeout);clearTimeout(t.handshakeTimeout);var r=t.swarm;var n=t.conn;var a=t.wire;t.conn=null;t.swarm=null;t.wire=null;if(r&&a){var s=r.wires.indexOf(a);if(s>=0)r.wires.splice(s,1)}if(n)n.destroy();if(a)a.destroy();if(r)r.removePeer(t.id)}},{"./webconn":13,"bittorrent-protocol":14,debug:121}],12:[function(e,t,r){(function(r){t.exports=f;var i=e("debug")("bittorrent-swarm:tcp-pool");var n=e("dezalgo");var a=e("net");var s=e("./peer");var o={};function f(e,t){var r=this;r.port=e;r.listening=false;r.swarms={};i("new TCPPool (port: %s, hostname: %s)",e,t);r.pendingConns=[];r.server=a.createServer();r.server.on("connection",function(e){r._onConnection(e)});r.server.on("error",function(e){r._onError(e)});r.server.on("listening",function(){r._onListening()});r.server.listen(r.port,t)}f.addSwarm=function(e){var t=o[e._port];if(!t)t=o[e._port]=new f(e._port,e._hostname);t.addSwarm(e);return t};f.removeSwarm=function(e,t){var i=o[e._port];if(!i)return t();i.removeSwarm(e);var n=0;for(var a in i.swarms){var s=i.swarms[a];if(s)n+=1}if(n===0)i.destroy(t);else r.nextTick(t)};f.getDefaultListenPort=function(e){for(var t in o){var r=o[t];if(r&&!r.swarms[e])return r.port}return 0};f.prototype.addSwarm=function(e){var t=this;if(t.swarms[e.infoHashHex]){r.nextTick(function(){e._onError(new Error("There is already a swarm with info hash "+e.infoHashHex+" "+"listening on port "+e._port))});return}t.swarms[e.infoHashHex]=e;if(t.listening){r.nextTick(function(){e._onListening(t.port)})}i("add swarm %s to tcp pool %s",e.infoHashHex,t.port)};f.prototype.removeSwarm=function(e){var t=this;i("remove swarm %s from tcp pool %s",e.infoHashHex,t.port);t.swarms[e.infoHashHex]=null};f.prototype.destroy=function(e){var t=this;if(e)e=n(e);i("destroy tcp pool %s",t.port);t.listening=false;t.pendingConns.forEach(function(e){e.destroy()});o[t.port]=null;try{t.server.close(e)}catch(r){if(e)e(null)}};f.prototype._onListening=function(){var e=this;var t=e.server.address()||{port:0};var r=t.port;i("tcp pool listening on %s",r);if(r!==e.port){o[e.port]=null;e.port=r;o[e.port]=e}e.listening=true;for(var n in e.swarms){var a=e.swarms[n];if(a)a._onListening(e.port)}};f.prototype._onConnection=function(e){var t=this;t.pendingConns.push(e);e.once("close",r);function r(){t.pendingConns.splice(t.pendingConns.indexOf(e))}var i=s.createIncomingTCPPeer(e);i.wire.once("handshake",function(n,a){var s=n.toString("hex");r();e.removeListener("close",r);var o=t.swarms[s];if(o){i.swarm=o;o._addIncomingPeer(i);i.onHandshake(n,a)}else{var f=new Error("Unexpected info hash "+s+" from incoming peer "+i.id+": destroying peer");i.destroy(f)}})};f.prototype._onError=function(e){var t=this;t.destroy();for(var r in t.swarms){var i=t.swarms[r];if(i){t.removeSwarm(i);i._onError(e)}}}}).call(this,e("_process"))},{"./peer":11,_process:49,debug:121,dezalgo:19,net:38}],13:[function(e,t,r){(function(r){t.exports=f;var i=e("bitfield");var n=e("debug")("bittorrent-swarm:webconn");var a=e("simple-get");var s=e("inherits");var o=e("bittorrent-protocol");s(f,o);function f(e,t){var a=this;o.call(this);a.url=e;a.parsedTorrent=t;a.setKeepAlive(true);a.on("handshake",function(t,n){a.handshake(t,new r(20).fill(e));var s=a.parsedTorrent.pieces.length;var o=new i(s);for(var f=0;f<=s;f++){o.set(f,true)}a.bitfield(o)});a.on("choke",function(){n("choke")});a.on("unchoke",function(){n("unchoke")});a.once("interested",function(){n("interested");a.unchoke()});a.on("uninterested",function(){n("uninterested")});a.on("bitfield",function(){n("bitfield")});a.on("request",function(e,t,r,i){n("request pieceIndex=%d offset=%d length=%d",e,t,r);a.httpRequest(e,t,r,i)})}f.prototype.httpRequest=function(e,t,r,i){var s=this;var o=e*s.parsedTorrent.pieceLength;var f=o+t;var u=f+r-1;n("Requesting pieceIndex=%d offset=%d length=%d start=%d end=%d",e,t,r,f,u);var l={url:s.url,method:"GET",headers:{"user-agent":"WebTorrent (http://webtorrent.io)",range:"bytes="+f+"-"+u}};a.concat(l,function(e,t,r){if(e)return i(e);if(r.statusCode<200||r.statusCode>=300){return i(new Error("Unexpected HTTP status code "+r.statusCode))}n("Got data of length %d",t.length);i(null,t)})}}).call(this,e("buffer").Buffer)},{bitfield:9,"bittorrent-protocol":14,buffer:39,debug:121,inherits:129,"simple-get":160}],14:[function(e,t,r){(function(r){t.exports=w;var i=e("bencode");var n=e("bitfield");var a=e("debug")("bittorrent-protocol");var s=e("xtend");var o=e("hat");var f=e("inherits");var u=e("speedometer");var l=e("stream");var c=4e5;var p=new r("BitTorrent protocol");var d=new r([0,0,0,0]);var h=new r([0,0,0,1,0]);var m=new r([0,0,0,1,1]);var v=new r([0,0,0,1,2]);var g=new r([0,0,0,1,3]);var y=[0,0,0,0,0,0,0,0];var _=[0,0,0,3,9,0,0];function b(e,t,r,i){this.piece=e;this.offset=t;this.length=r;this.callback=i}f(w,l.Duplex);function w(){if(!(this instanceof w))return new w;l.Duplex.call(this);this._debugId=o(32);this._debug("new wire");this.amChoking=true;this.amInterested=false;this.peerChoking=true;this.peerInterested=false;this.peerPieces=new n(0,{grow:c});this.peerExtensions={};this.requests=[];this.peerRequests=[];this.extendedMapping={};this.peerExtendedMapping={};this.extendedHandshake={};this.peerExtendedHandshake={};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.destroyed=false;this._finished=false;this._buffer=[];this._bufferSize=0;this._parser=null;this._parserSize=0;this.on("finish",this._onfinish);this._parseHandshake()}w.prototype.setKeepAlive=function(e){this._debug("setKeepAlive %s",e);clearInterval(this._keepAliveInterval);if(e===false)return;this._keepAliveInterval=setInterval(this.keepAlive.bind(this),6e4)};w.prototype.setTimeout=function(e,t){this._debug("setTimeout ms=%d unref=%s",e,t);this._clearTimeout();this._timeoutMs=e;this._timeoutUnref=!!t;this._updateTimeout()};w.prototype.destroy=function(){if(this.destroyed)return;this.destroyed=true;this._debug("destroy");this.emit("close");this.end()};w.prototype.end=function(){this._debug("end");this._onUninterested();this._onChoke();l.Duplex.prototype.end.apply(this,arguments)};w.prototype.use=function(e){var 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);var r=this._nextExt;var i=new e(this);function n(){}if(typeof i.onHandshake!=="function"){i.onHandshake=n}if(typeof i.onExtendedHandshake!=="function"){i.onExtendedHandshake=n}if(typeof i.onMessage!=="function"){i.onMessage=n}this.extendedMapping[r]=t;this._ext[t]=i;this[t]=i;this._nextExt+=1};w.prototype.keepAlive=function(){this._debug("keep-alive");this._push(d)};w.prototype.handshake=function(e,t,i){if(typeof e==="string")e=new r(e,"hex");if(typeof t==="string")t=new r(t,"hex");if(e.length!==20||t.length!==20){throw new Error("infoHash and peerId MUST have length 20")}this._debug("handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),i);var n=new r(y);n[5]|=16;if(i&&i.dht)n[7]|=1;this._push(r.concat([p,n,e,t]));this._handshakeSent=true;if(this.peerExtensions.extended){this._sendExtendedHandshake()}};w.prototype._sendExtendedHandshake=function(){var e=s(this.extendedHandshake);e.m={};for(var t in this.extendedMapping){var r=this.extendedMapping[t];e.m[r]=Number(t)}this.extended(0,i.encode(e))};w.prototype.choke=function(){if(this.amChoking)return;this.amChoking=true;this._debug("choke");this.peerRequests.splice(0,this.peerRequests.length);this._push(h)};w.prototype.unchoke=function(){if(!this.amChoking)return;this.amChoking=false;this._debug("unchoke");this._push(m)};w.prototype.interested=function(){if(this.amInterested)return;this.amInterested=true;this._debug("interested");this._push(v)};w.prototype.uninterested=function(){if(!this.amInterested)return;this.amInterested=false;this._debug("uninterested");this._push(g)};w.prototype.have=function(e){this._debug("have %d",e);this._message(4,[e],null)};w.prototype.bitfield=function(e){this._debug("bitfield");if(!r.isBuffer(e))e=e.buffer;this._message(5,[],e)};w.prototype.request=function(e,t,r,i){if(!i)i=function(){};if(this._finished)return i(new Error("wire is closed"));if(this.peerChoking)return i(new Error("peer is choking"));this._debug("request index=%d offset=%d length=%d",e,t,r);this.requests.push(new b(e,t,r,i));this._updateTimeout();this._message(6,[e,t,r],null)};w.prototype.piece=function(e,t,r){this._debug("piece index=%d offset=%d",e,t);this.uploaded+=r.length;this.uploadSpeed(r.length);this.emit("upload",r.length);this._message(7,[e,t],r)};w.prototype.cancel=function(e,t,r){this._debug("cancel index=%d offset=%d length=%d",e,t,r);this._callback(x(this.requests,e,t,r),new Error("request was cancelled"),null);this._message(8,[e,t,r],null)};w.prototype.port=function(e){this._debug("port %d",e);var t=new r(_);t.writeUInt16BE(e,5);this._push(t)};w.prototype.extended=function(e,t){this._debug("extended ext=%s",e);if(typeof e==="string"&&this.peerExtendedMapping[e]){e=this.peerExtendedMapping[e]}if(typeof e==="number"){var n=new r([e]);var a=r.isBuffer(t)?t:i.encode(t);this._message(20,[],r.concat([n,a]))}else{throw new Error("Unrecognized extension: "+e)}};w.prototype._onKeepAlive=function(){this._debug("got keep-alive");this.emit("keep-alive")};w.prototype._onHandshake=function(e,t,r){this._debug("got handshake i=%s p=%s exts=%o",e.toString("hex"),t.toString("hex"),r);this.peerId=t;this.peerExtensions=r;this.emit("handshake",e,t,r);var i;for(i in this._ext){this._ext[i].onHandshake(e,t,r)}if(r.extended&&this._handshakeSent){this._sendExtendedHandshake()}};w.prototype._onChoke=function(){this.peerChoking=true;this._debug("got choke");this.emit("choke");while(this.requests.length){this._callback(this.requests.shift(),new Error("peer is choking"),null)}};w.prototype._onUnchoke=function(){this.peerChoking=false;this._debug("got unchoke");this.emit("unchoke")};w.prototype._onInterested=function(){this.peerInterested=true;this._debug("got interested");this.emit("interested")};w.prototype._onUninterested=function(){this.peerInterested=false;this._debug("got uninterested");this.emit("uninterested")};w.prototype._onHave=function(e){if(this.peerPieces.get(e))return;this._debug("got have %d",e);this.peerPieces.set(e,true);this.emit("have",e)};w.prototype._onBitField=function(e){this.peerPieces=new n(e);this._debug("got bitfield");this.emit("bitfield",this.peerPieces)};w.prototype._onRequest=function(e,t,r){if(this.amChoking)return;this._debug("got request index=%d offset=%d length=%d",e,t,r);var i=function(i,a){if(n!==x(this.peerRequests,e,t,r))return;if(i)return;this.piece(e,t,a)}.bind(this);var n=new b(e,t,r,i);this.peerRequests.push(n);this.emit("request",e,t,r,i)};w.prototype._onPiece=function(e,t,r){this._debug("got piece index=%d offset=%d",e,t);this._callback(x(this.requests,e,t,r.length),null,r);this.downloaded+=r.length;this.downloadSpeed(r.length);this.emit("download",r.length);this.emit("piece",e,t,r)};w.prototype._onCancel=function(e,t,r){this._debug("got cancel index=%d offset=%d length=%d",e,t,r);x(this.peerRequests,e,t,r);this.emit("cancel",e,t,r)};w.prototype._onPort=function(e){this._debug("got port %d",e);this.emit("port",e)};w.prototype._onExtended=function(e,t){if(e===0){var r;try{r=i.decode(t)}catch(n){this._debug("ignoring invalid extended handshake: %s",n.message||n)}if(!r)return;this.peerExtendedHandshake=r;var a;if(typeof r.m==="object"){for(a in r.m){this.peerExtendedMapping[a]=Number(r.m[a].toString())}}for(a in this._ext){if(this.peerExtendedMapping[a]){this._ext[a].onExtendedHandshake(this.peerExtendedHandshake)}}this._debug("got extended handshake");this.emit("extended","handshake",this.peerExtendedHandshake)}else{if(this.extendedMapping[e]){e=this.extendedMapping[e];if(this._ext[e]){this._ext[e].onMessage(t)}}this._debug("got extended message ext=%s",e);this.emit("extended",e,t)}};w.prototype._onTimeout=function(){this._debug("request timed out");this._callback(this.requests.shift(),new Error("request has timed out"),null);this.emit("timeout")};w.prototype._push=function(e){if(this._finished)return;return this.push(e)};w.prototype._write=function(e,t,i){this._bufferSize+=e.length;this._buffer.push(e);while(this._bufferSize>=this._parserSize){var n=this._buffer.length===1?this._buffer[0]:r.concat(this._buffer);this._bufferSize-=this._parserSize;this._buffer=this._bufferSize?[n.slice(this._parserSize)]:[];this._parser(n.slice(0,this._parserSize))}i(null)};w.prototype._read=function(){};w.prototype._callback=function(e,t,r){if(!e)return;this._clearTimeout();if(!this.peerChoking&&!this._finished)this._updateTimeout();e.callback(t,r)};w.prototype._clearTimeout=function(){if(!this._timeout)return;clearTimeout(this._timeout);this._timeout=null};w.prototype._updateTimeout=function(){if(!this._timeoutMs||!this.requests.length||this._timeout)return;this._timeout=setTimeout(this._onTimeout.bind(this),this._timeoutMs);if(this._timeoutUnref&&this._timeout.unref)this._timeout.unref()};w.prototype._parse=function(e,t){this._parserSize=e;this._parser=t};w.prototype._message=function(e,t,i){var n=i?i.length:0;var a=new r(5+4*t.length);a.writeUInt32BE(a.length+n-4,0);a[4]=e;for(var s=0;s0){this._parse(t,this._onmessage)}else{this._onKeepAlive();this._parse(4,this._onmessagelength)}};w.prototype._onmessage=function(e){this._parse(4,this._onmessagelength);switch(e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:this._debug("got unknown message");return this.emit("unknownmessage",e)}};w.prototype._parseHandshake=function(){this._parse(1,function(e){var t=e.readUInt8(0);this._parse(t+48,function(e){var r=e.slice(0,t);if(r.toString()!=="BitTorrent protocol"){this._debug("Error: wire not speaking BitTorrent protocol (%s)",r.toString());this.end();return}e=e.slice(t);this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(e[7]&1),extended:!!(e[5]&16)});this._parse(4,this._onmessagelength)}.bind(this))}.bind(this))};w.prototype._onfinish=function(){this._finished=true;this.push(null);while(this.read()){}clearInterval(this._keepAliveInterval);this._parse(Number.MAX_VALUE,function(){});this.peerRequests=[];while(this.requests.length){this._callback(this.requests.shift(),new Error("wire was closed"),null)}};w.prototype._debug=function(){var e=[].slice.call(arguments);e[0]="["+this._debugId+"] "+e[0];a.apply(null,e)};function x(e,t,r,i){for(var n=0;no){for(var t=0,r=i.length-s;ti._maxBufferedAmount){i._debug("start backpressure: bufferedAmount %d",i._channel.bufferedAmount);i._cb=r}else{r(null)}}else{i._debug("write before connect");i._chunk=e;i._cb=r}};c.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.offerConstraints)};c.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,p,e._onError.bind(e));var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},e._onError.bind(e),e.answerConstraints)};c.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="closed"){e._destroy()}};c.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){e._pc.getStats(null,function(e){var r=[];e.forEach(function(e){r.push(e)});t(r)},e._onError.bind(e))}else{e._pc.getStats(function(e){var r=[];e.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});t(r)})}function t(t){t.forEach(function(t){if(t.type==="remotecandidate"){e.remoteAddress=t.ipAddress;e.remotePort=Number(t.portNumber);e.remoteFamily="IPv4";e._debug("connect remote: %s:%s (%s)",e.remoteAddress,e.remotePort,e.remoteFamily)}else if(t.type==="localcandidate"&&t.candidateType==="host"){e.localAddress=t.ipAddress;e.localPort=Number(t.portNumber);e._debug("connect local: %s:%s",e.localAddress,e.localPort)}});e._connecting=false;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(r){return e._onError(r)}e._chunk=null;e._debug('sent chunk from "write before connect"');var i=e._cb;e._cb=null;i(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")}};c.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};c.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};c.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length);if(r instanceof ArrayBuffer){r=l(new Uint8Array(r));t.push(r)}else{try{r=JSON.parse(r)}catch(i){}t.emit("data",r)}};c.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};c.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};c.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};c.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};c.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);var r=e.channelName&&e.channelName.substring(0,7);t[0]="["+r+"] "+t[0];i.apply(null,t)};function p(){}}).call(this,{isBuffer:e("/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")})},{"/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":45,debug:121,"get-browser-rtc":31,hat:127,inherits:129,"is-typedarray":32,once:29,stream:67,"typedarray-to-buffer":33}],31:[function(e,t,r){t.exports=function i(){if(typeof window==="undefined")return null;var e={RTCPeerConnection:window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate};if(!e.RTCPeerConnection)return null;return e}},{}],32:[function(e,t,r){t.exports=a;a.strict=s;a.loose=o;var i=Object.prototype.toString;var n={"[object Int8Array]":true,"[object Int16Array]":true,"[object Int32Array]":true,"[object Uint8Array]":true,"[object Uint8ClampedArray]":true,"[object Uint16Array]":true,"[object Uint32Array]":true,"[object Float32Array]":true,"[object Float64Array]":true};function a(e){return s(e)||o(e)}function s(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return n[i.call(e)]}},{}],33:[function(e,t,r){(function(r){var i=e("is-typedarray").strict;t.exports=function(e){var t=r.TYPED_ARRAY_SUPPORT?r._augment:function(e){return new r(e)};if(e instanceof Uint8Array){return t(e)}else if(e instanceof ArrayBuffer){return t(new Uint8Array(e))}else if(i(e)){return t(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}else{return new r(e)}}}).call(this,e("buffer").Buffer)},{buffer:39,"is-typedarray":32}],34:[function(e,t,r){(function(r){t.exports=l;var i=e("debug")("simple-websocket");var n=e("inherits");var a=e("is-typedarray");var s=e("stream");var o=e("typedarray-to-buffer");var f=e("ws");var u=typeof window!=="undefined"?window.WebSocket:f;n(l,s.Duplex);function l(e,t){var r=this;if(!(r instanceof l))return new l(e,t);if(!t)t={};i("new websocket: %s %o",e,t);t.allowHalfOpen=false;if(t.highWaterMark==null)t.highWaterMark=1024*1024;s.Duplex.call(r,t);r.url=e;r.connected=false;r.destroyed=false;r._maxBufferedAmount=t.highWaterMark;r._chunk=null;r._cb=null;r._interval=null;r._ws=new u(r.url);r._ws.binaryType="arraybuffer";r._ws.onopen=r._onOpen.bind(r);r._ws.onmessage=r._onMessage.bind(r);r._ws.onclose=r._onClose.bind(r);r._ws.onerror=function(){r._onError(new Error("connection error to "+r.url))};r.on("finish",function(){if(r.connected){setTimeout(function(){r._destroy()},100)}else{r.once("connect",function(){setTimeout(function(){r._destroy()},100)})}})}l.prototype.send=function(e){var t=this;if(!a.strict(e)&&!(e instanceof ArrayBuffer)&&!r.isBuffer(e)&&typeof e!=="string"&&(typeof Blob==="undefined"||!(e instanceof Blob))){e=JSON.stringify(e)}var n=e.length||e.byteLength||e.size;t._ws.send(e);i("write: %d bytes",n)};l.prototype.destroy=function(e){var t=this;t._destroy(null,e)};l.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);i("destroy (error: %s)",e&&e.message);this.readable=this.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.connected=false;r.destroyed=true;clearInterval(r._interval);r._interval=null;r._chunk=null;r._cb=null;if(r._ws){var n=r._ws;var a=function(){n.onclose=null;r.emit("close")};if(n.readyState===u.CLOSED){a()}else{try{n.onclose=a;n.close()}catch(e){a()}}n.onopen=null;n.onmessage=null;n.onerror=null}r._ws=null;if(e)r.emit("error",e)};l.prototype._read=function(){};l.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after socket is destroyed"));if(n.connected){try{n.send(e)}catch(a){return n._onError(a)}if(typeof f!=="function"&&n._ws.bufferedAmount>n._maxBufferedAmount){i("start backpressure: bufferedAmount %d",n._ws.bufferedAmount);n._cb=r}else{r(null)}}else{i("write before connect");n._chunk=e;n._cb=r}};l.prototype._onMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;i("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer){n=o(new Uint8Array(n));t.push(n)}else if(r.isBuffer(n)){t.push(n)}else{try{n=JSON.parse(n)}catch(a){}t.emit("data",n)}};l.prototype._onOpen=function(){var e=this;if(e.connected||e.destroyed)return;e.connected=true;if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;i('sent chunk from "write before connect"');var r=e._cb;e._cb=null;r(null)}if(typeof f!=="function"){e._interval=setInterval(function(){if(!e._cb||!e._ws||e._ws.bufferedAmount>e._maxBufferedAmount){return}i("ending backpressure: bufferedAmount %d",e._ws.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref()}i("connect");e.emit("connect")};l.prototype._onClose=function(){var e=this;if(e.destroyed)return;i("on close");e._destroy()};l.prototype._onError=function(e){var t=this;if(t.destroyed)return;i("error: %s",e.message||e);t._destroy(e)}}).call(this,{isBuffer:e("/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")})},{"/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":45,debug:121,inherits:129,"is-typedarray":35,stream:67,"typedarray-to-buffer":36,ws:38}],35:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],36:[function(e,t,r){arguments[4][33][0].apply(r,arguments)},{buffer:39,dup:33,"is-typedarray":35}],37:[function(e,t,r){},{}],38:[function(e,t,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],39:[function(e,t,r){(function(t){var i=e("base64-js");var n=e("ieee754");var a=e("is-array");r.Buffer=f;r.SlowBuffer=b;r.INSPECT_MAX_BYTES=50;f.poolSize=8192;var s={};f.TYPED_ARRAY_SUPPORT=t.TYPED_ARRAY_SUPPORT!==undefined?t.TYPED_ARRAY_SUPPORT:function(){function e(){}try{var t=new Uint8Array(1);t.foo=function(){return 42};t.constructor=e;return t.foo()===42&&t.constructor===e&&typeof t.subarray==="function"&&t.subarray(1,1).byteLength===0}catch(r){return false}}();function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e){if(!(this instanceof f)){if(arguments.length>1)return new f(e,arguments[1]);return new f(e)}this.length=0;this.parent=undefined;if(typeof e==="number"){return u(this,e)}if(typeof e==="string"){return l(this,e,arguments.length>1?arguments[1]:"utf8")}return c(this,e)}function u(e,t){e=y(e,t<0?0:_(t)|0);if(!f.TYPED_ARRAY_SUPPORT){for(var r=0;r>>1;if(r)e.parent=s;return e}function _(e){if(e>=o()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o().toString(16)+" bytes")}return e|0}function b(e,t){if(!(this instanceof b))return new b(e,t);var r=new f(e,t);delete r.parent;return r}f.isBuffer=function ee(e){return!!(e!=null&&e._isBuffer)};f.compare=function te(e,t){if(!f.isBuffer(e)||!f.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var i=t.length;var n=0;var a=Math.min(r,i);while(n>>1;case"base64":return J(e).length;default:if(i)return K(e).length;t=(""+t).toLowerCase();i=true}}}f.byteLength=w;f.prototype.length=undefined;f.prototype.parent=undefined;function x(e,t,r){var i=false;t=t|0;r=r===undefined||r===Infinity?this.length:r|0;if(!e)e="utf8";if(t<0)t=0;if(r>this.length)r=this.length;if(r<=t)return"";while(true){switch(e){case"hex":return z(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return R(this,t,r);case"binary":return P(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();i=true}}}f.prototype.toString=function ne(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return L(this,0,e);return x.apply(this,arguments)};f.prototype.equals=function ae(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function se(){var e="";var t=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""};f.prototype.compare=function oe(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return 0;return f.compare(this,e)};f.prototype.indexOf=function fe(e,t){if(t>2147483647)t=2147483647;else if(t<-2147483648)t=-2147483648;t>>=0;if(this.length===0)return-1;if(t>=this.length)return-1;if(t<0)t=Math.max(this.length+t,0);if(typeof e==="string"){if(e.length===0)return-1;return String.prototype.indexOf.call(this,e,t)}if(f.isBuffer(e)){return r(this,e,t)}if(typeof e==="number"){if(f.TYPED_ARRAY_SUPPORT&&Uint8Array.prototype.indexOf==="function"){return Uint8Array.prototype.indexOf.call(this,e,t)}return r(this,[e],t)}function r(e,t,r){var i=-1;for(var n=0;r+nn){i=n}}var a=t.length;if(a%2!==0)throw new Error("Invalid hex string");if(i>a/2){i=a/2}for(var s=0;sa)r=a;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return E(this,e,t,r);case"binary":return A(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function pe(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(e,t,r){if(t===0&&r===e.length){return i.fromByteArray(e)}else{return i.fromByteArray(e.slice(t,r))}}function L(e,t,r){r=Math.min(e.length,r);var i=[];var n=t;while(n239?4:a>223?3:a>191?2:1;if(n+o<=r){var f,u,l,c;switch(o){case 1:if(a<128){s=a}break;case 2:f=e[n+1];if((f&192)===128){c=(a&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[n+1];u=e[n+2];if((f&192)===128&&(u&192)===128){c=(a&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[n+1];u=e[n+2];l=e[n+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(a&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;o=1}else if(s>65535){s-=65536;i.push(s>>>10&1023|55296);s=56320|s&1023}i.push(s);n+=o}return C(i)}var B=4096;function C(e){var t=e.length;if(t<=B){return String.fromCharCode.apply(String,e)}var r="";var i=0;while(ii)r=i;var n="";for(var a=t;ar){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(tr)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function he(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a0&&(n*=256)){i+=this[e+--t]*n}return i};f.prototype.readUInt8=function ve(e,t){if(!t)F(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function ge(e,t){if(!t)F(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function ye(e,t){if(!t)F(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function _e(e,t){if(!t)F(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function be(e,t){if(!t)F(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function we(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=this[e];var n=1;var a=0;while(++a=n)i-=Math.pow(2,8*t);return i};f.prototype.readIntBE=function xe(e,t,r){e=e|0;t=t|0;if(!r)F(e,t,this.length);var i=t;var n=1;var a=this[e+--i];while(i>0&&(n*=256)){a+=this[e+--i]*n}n*=128;if(a>=n)a-=Math.pow(2,8*t);return a};f.prototype.readInt8=function ke(e,t){if(!t)F(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function Se(e,t){if(!t)F(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};f.prototype.readInt16BE=function Ee(e,t){if(!t)F(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};f.prototype.readInt32LE=function Ae(e,t){if(!t)F(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function Ue(e,t){if(!t)F(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function Te(e,t){if(!t)F(e,4,this.length);return n.read(this,e,true,23,4)};f.prototype.readFloatBE=function Ie(e,t){if(!t)F(e,4,this.length);return n.read(this,e,false,23,4)};f.prototype.readDoubleLE=function Le(e,t){if(!t)F(e,8,this.length);return n.read(this,e,true,52,8)};f.prototype.readDoubleBE=function Be(e,t){if(!t)F(e,8,this.length);return n.read(this,e,false,52,8)};function M(e,t,r,i,n,a){if(!f.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>n||te.length)throw new RangeError("index out of range")}f.prototype.writeUIntLE=function Ce(e,t,r,i){e=+e;t=t|0;r=r|0;if(!i)M(this,e,t,r,Math.pow(2,8*r),0);var n=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256)){this[t+n]=e/a&255}return t+r};f.prototype.writeUInt8=function Pe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,255,0);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e;return t+1};function j(e,t,r,i){if(t<0)t=65535+t+1;for(var n=0,a=Math.min(e.length-r,2);n>>(i?n:1-n)*8}}f.prototype.writeUInt16LE=function ze(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeUInt16BE=function Oe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,65535,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};function D(e,t,r,i){if(t<0)t=4294967295+t+1;for(var n=0,a=Math.min(e.length-r,4);n>>(i?n:3-n)*8&255}}f.prototype.writeUInt32LE=function Fe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e}else{D(this,e,t,true)}return t+4; };f.prototype.writeUInt32BE=function Me(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,4294967295,0);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};f.prototype.writeIntLE=function je(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=0;var s=1;var o=e<0?1:0;this[t]=e&255;while(++a>0)-o&255}return t+r};f.prototype.writeIntBE=function De(e,t,r,i){e=+e;t=t|0;if(!i){var n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}var a=r-1;var s=1;var o=e<0?1:0;this[t+a]=e&255;while(--a>=0&&(s*=256)){this[t+a]=(e/s>>0)-o&255}return t+r};f.prototype.writeInt8=function Ne(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,1,127,-128);if(!f.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e;return t+1};f.prototype.writeInt16LE=function He(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8}else{j(this,e,t,true)}return t+2};f.prototype.writeInt16BE=function qe(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,2,32767,-32768);if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e}else{j(this,e,t,false)}return t+2};f.prototype.writeInt32LE=function Ge(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(f.TYPED_ARRAY_SUPPORT){this[t]=e;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{D(this,e,t,true)}return t+4};f.prototype.writeInt32BE=function We(e,t,r){e=+e;t=t|0;if(!r)M(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(f.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e}else{D(this,e,t,false)}return t+4};function N(e,t,r,i,n,a){if(t>n||te.length)throw new RangeError("index out of range");if(r<0)throw new RangeError("index out of range")}function H(e,t,r,i,a){if(!a){N(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}n.write(e,t,r,i,23,4);return r+4}f.prototype.writeFloatLE=function Ve(e,t,r){return H(this,e,t,true,r)};f.prototype.writeFloatBE=function Ye(e,t,r){return H(this,e,t,false,r)};function q(e,t,r,i,a){if(!a){N(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}n.write(e,t,r,i,52,8);return r+8}f.prototype.writeDoubleLE=function $e(e,t,r){return q(this,e,t,true,r)};f.prototype.writeDoubleBE=function Ke(e,t,r){return q(this,e,t,false,r)};f.prototype.copy=function Ze(e,t,r,i){if(!r)r=0;if(!i&&i!==0)i=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-t=0;a--){e[a+t]=this[a+r]}}else if(n<1e3||!f.TYPED_ARRAY_SUPPORT){for(a=0;a=this.length)throw new RangeError("start out of bounds");if(r<0||r>this.length)throw new RangeError("end out of bounds");var i;if(typeof e==="number"){for(i=t;i55295&&r<57344){if(!n){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(s+1===i){if((t-=3)>-1)a.push(239,191,189);continue}n=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);n=r;continue}r=n-55296<<10|r-56320|65536}else if(n){if((t-=3)>-1)a.push(239,191,189)}n=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function Z(e){var t=[];for(var r=0;r>8;n=r%256;a.push(n);a.push(i)}return a}function J(e){return i.toByteArray(V(e))}function Q(e,t,r,i){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"base64-js":40,ieee754:41,"is-array":42}],40:[function(e,t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(e){"use strict";var t=typeof Uint8Array!=="undefined"?Uint8Array:Array;var r="+".charCodeAt(0);var n="/".charCodeAt(0);var a="0".charCodeAt(0);var s="a".charCodeAt(0);var o="A".charCodeAt(0);var f="-".charCodeAt(0);var u="_".charCodeAt(0);function l(e){var t=e.charCodeAt(0);if(t===r||t===f)return 62;if(t===n||t===u)return 63;if(t0){throw new Error("Invalid string. Length must be a multiple of 4")}var f=e.length;s="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0;o=new t(e.length*3/4-s);n=s>0?e.length-4:e.length;var u=0;function c(e){o[u++]=e}for(r=0,i=0;r>16);c((a&65280)>>8);c(a&255)}if(s===2){a=l(e.charAt(r))<<2|l(e.charAt(r+1))>>4;c(a&255)}else if(s===1){a=l(e.charAt(r))<<10|l(e.charAt(r+1))<<4|l(e.charAt(r+2))>>2;c(a>>8&255);c(a&255)}return o}function p(e){var t,r=e.length%3,n="",a,s;function o(e){return i.charAt(e)}function f(e){return o(e>>18&63)+o(e>>12&63)+o(e>>6&63)+o(e&63)}for(t=0,s=e.length-r;t>2);n+=o(a<<4&63);n+="==";break;case 2:a=(e[e.length-2]<<8)+e[e.length-1];n+=o(a>>10);n+=o(a>>4&63);n+=o(a<<2&63);n+="=";break}return n}e.toByteArray=c;e.fromByteArray=p})(typeof r==="undefined"?this.base64js={}:r)},{}],41:[function(e,t,r){r.read=function(e,t,r,i,n){var a,s;var o=n*8-i-1;var f=(1<>1;var l=-7;var c=r?n-1:0;var p=r?-1:1;var d=e[t+c];c+=p;a=d&(1<<-l)-1;d>>=-l;l+=o;for(;l>0;a=a*256+e[t+c],c+=p,l-=8){}s=a&(1<<-l)-1;a>>=-l;l+=i;for(;l>0;s=s*256+e[t+c],c+=p,l-=8){}if(a===0){a=1-u}else if(a===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,i);a=a-u}return(d?-1:1)*s*Math.pow(2,a-i)};r.write=function(e,t,r,i,n,a){var s,o,f;var u=a*8-n-1;var l=(1<>1;var p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=i?0:a-1;var h=i?1:-1;var m=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){o=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=p/f}else{t+=p*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){o=0;s=l}else if(s+c>=1){o=(t*f-1)*Math.pow(2,n);s=s+c}else{o=t*Math.pow(2,c-1)*Math.pow(2,n);s=0}}for(;n>=8;e[r+d]=o&255,d+=h,o/=256,n-=8){}s=s<0;e[r+d]=s&255,d+=h,s/=256,u-=8){}e[r+d-h]|=m*128}},{}],42:[function(e,t,r){var i=Array.isArray;var n=Object.prototype.toString;t.exports=i||function(e){return!!e&&"[object Array]"==n.call(e)}},{}],43:[function(e,t,r){function i(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=i;i.EventEmitter=i;i.prototype._events=undefined;i.prototype._maxListeners=undefined;i.defaultMaxListeners=10;i.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};i.prototype.emit=function(e){var t,r,i,a,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}throw TypeError('Uncaught, unspecified "error" event.')}}r=this._events[e];if(o(r))return false;if(n(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=arguments.length;a=new Array(i-1);for(f=1;f0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};i.prototype.on=i.prototype.addListener;i.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=false;function i(){this.removeListener(e,i);if(!r){r=true;t.apply(this,arguments)}}i.listener=t;this.on(e,i);return this};i.prototype.removeListener=function(e,t){var r,i,a,o;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];a=r.length;i=-1;if(r===t||n(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(o=a;o-->0;){if(r[o]===t||r[o].listener&&r[o].listener===t){i=o;break}}if(i<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(i,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};i.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(n(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};i.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(n(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};i.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(n(e._events[t]))r=1;else r=e._events[t].length;return r};function n(e){return typeof e==="function"}function a(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function o(e){return e===void 0}},{}],44:[function(e,t,r){var i=e("http");var n=t.exports;for(var a in i){if(i.hasOwnProperty(a))n[a]=i[a]}n.request=function(e,t){if(!e)e={};e.scheme="https";e.protocol="https:";return i.request.call(this,e,t)}},{http:68}],45:[function(e,t,r){t.exports=function(e){return!!(e!=null&&(e._isBuffer||e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)))}},{}],46:[function(e,t,r){t.exports=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"}},{}],47:[function(e,t,r){r.endianness=function(){return"LE"};r.hostname=function(){if(typeof location!=="undefined"){return location.hostname}else return""};r.loadavg=function(){return[]};r.uptime=function(){return 0};r.freemem=function(){return Number.MAX_VALUE};r.totalmem=function(){return Number.MAX_VALUE};r.cpus=function(){return[]};r.type=function(){return"Browser"};r.release=function(){if(typeof navigator!=="undefined"){return navigator.appVersion}return""};r.networkInterfaces=r.getNetworkInterfaces=function(){return{}};r.arch=function(){return"javascript"};r.platform=function(){return"browser"};r.tmpdir=r.tmpDir=function(){return"/tmp"};r.EOL="\n"},{}],48:[function(e,t,r){(function(e){function t(e,t){var r=0;for(var i=e.length-1;i>=0;i--){var n=e[i];if(n==="."){e.splice(i,1)}else if(n===".."){e.splice(i,1);r++}else if(r){e.splice(i,1);r--}}if(t){for(;r--;r){e.unshift("..")}}return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var n=function(e){return i.exec(e).slice(1)};r.resolve=function(){var r="",i=false;for(var n=arguments.length-1;n>=-1&&!i;n--){var s=n>=0?arguments[n]:e.cwd();if(typeof s!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!s){continue}r=s+"/"+r;i=s.charAt(0)==="/"}r=t(a(r.split("/"),function(e){return!!e}),!i).join("/");return(i?"/":"")+r||"."};r.normalize=function(e){var i=r.isAbsolute(e),n=s(e,-1)==="/";e=t(a(e.split("/"),function(e){return!!e}),!i).join("/");if(!e&&!i){e="."}if(e&&n){e+="/"}return(i?"/":"")+e};r.isAbsolute=function(e){return e.charAt(0)==="/"};r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(a(e,function(e,t){if(typeof e!=="string"){throw new TypeError("Arguments to path.join must be strings")}return e}).join("/"))};r.relative=function(e,t){e=r.resolve(e).substr(1);t=r.resolve(t).substr(1);function i(e){var t=0;for(;t=0;r--){if(e[r]!=="")break}if(t>r)return[];return e.slice(t,r-t+1)}var n=i(e.split("/"));var a=i(t.split("/"));var s=Math.min(n.length,a.length);var o=s;for(var f=0;f1){for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=l-c,k=Math.floor,S=String.fromCharCode,E;function A(e){throw RangeError(w[e])}function U(e,t){var r=e.length;var i=[];while(r--){i[r]=t(e[r])}return i}function T(e,t){var r=e.split("@");var i="";if(r.length>1){i=r[0]+"@";e=r[1]}e=e.replace(b,".");var n=e.split(".");var a=U(n,t).join(".");return i+a}function I(e){var t=[],r=0,i=e.length,n,a;while(r=55296&&n<=56319&&r65535){e-=65536;t+=S(e>>>10&1023|55296);e=56320|e&1023}t+=S(e);return t}).join("")}function B(e){if(e-48<10){return e-22}if(e-65<26){return e-65}if(e-97<26){return e-97}return l}function C(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function R(e,t,r){var i=0;e=r?k(e/h):e>>1;e+=k(e/t);for(;e>x*p>>1;i+=l){e=k(e/x)}return k(i+(x+1)*e/(e+d))}function P(e){var t=[],r=e.length,i,n=0,a=v,s=m,o,f,d,h,y,_,b,w,x;o=e.lastIndexOf(g);if(o<0){o=0}for(f=0;f=128){A("not-basic")}t.push(e.charCodeAt(f))}for(d=o>0?o+1:0;d=r){A("invalid-input")}b=B(e.charCodeAt(d++));if(b>=l||b>k((u-n)/y)){A("overflow")}n+=b*y;w=_<=s?c:_>=s+p?p:_-s;if(bk(u/x)){A("overflow")}y*=x}i=t.length+1;s=R(n-h,i,h==0);if(k(n/i)>u-a){A("overflow")}a+=k(n/i);n%=i;t.splice(n++,0,a)}return L(t)}function z(e){var t,r,i,n,a,s,o,f,d,h,y,_=[],b,w,x,E;e=I(e);b=e.length;t=v;r=0;a=m;for(s=0;s=t&&yk((u-r)/w)){A("overflow")}r+=(o-t)*w;t=o;for(s=0;su){A("overflow")}if(y==t){for(f=r,d=l;;d+=l){h=d<=a?c:d>=a+p?p:d-a;if(f0&&u>f){u=f}for(var l=0;l=0){d=c.substr(0,p);h=c.substr(p+1)}else{d=c;h=""}m=decodeURIComponent(d);v=decodeURIComponent(h);if(!i(s,m)){s[m]=v}else if(n(s[m])){s[m].push(v)}else{s[m]=[s[m],v]}}return s};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],52:[function(e,t,r){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,o){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return a(s(e),function(s){var o=encodeURIComponent(i(s))+r;if(n(e[s])){return a(e[s],function(e){return o+encodeURIComponent(i(e))}).join(t)}else{return o+encodeURIComponent(i(e[s]))}}).join(t)}if(!o)return"";return encodeURIComponent(i(o))+r+encodeURIComponent(i(e))};var n=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function a(e,t){if(e.map)return e.map(t);var r=[];for(var i=0;i0){if(t.ended&&!n){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&n){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{if(t.decoder&&!n&&!i)r=t.decoder.write(r);if(!n)t.reading=false;if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)b(e)}x(e,t)}}else if(!n){t.reading=false}return h(t)}function h(e){return!e.ended&&(e.needReadable||e.length=m){e=m}else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function g(e,t){if(t.length===0&&t.ended)return 0;if(t.objectMode)return e===0?0:1;if(e===null||isNaN(e)){if(t.flowing&&t.buffer.length)return t.buffer[0].length;else return t.length}if(e<=0)return 0;if(e>t.highWaterMark)t.highWaterMark=v(e);if(e>t.length){if(!t.ended){t.needReadable=true;return 0}else{return t.length}}return e}p.prototype.read=function(e){u("read",e);var t=this._readableState;var r=e;if(typeof e!=="number"||e>0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){u("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)L(this);else b(this);return null}e=g(e,t);if(e===0&&t.ended){if(t.length===0)L(this);return null}var i=t.needReadable;u("need readable",i);if(t.length===0||t.length-e0)n=I(e,t);else n=null;if(n===null){t.needReadable=true;e=0}t.length-=e;if(t.length===0&&!t.ended)t.needReadable=true;if(r!==e&&t.ended&&t.length===0)L(this);if(n!==null)this.emit("data",n);return n};function y(e,t){var r=null;if(!a.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function _(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;b(e)}function b(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){u("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i(w,e);else w(e)}}function w(e){u("emit readable");e.emit("readable");T(e)}function x(e,t){if(!t.readingMore){t.readingMore=true;i(k,e,t)}}function k(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":141,uniq:168,xtend:181}],141:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":142}],142:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],143:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":124,fs:37,once:151}],150:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],151:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:150}],152:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],153:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],154:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],155:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:156}],156:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:157,dup:19,wrappy:159}],157:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":158,dup:20}],158:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],159:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],160:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:68,https:44,once:162,"unzip-response":38,url:78,xtend:181}],161:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],162:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:161}],163:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:164}],164:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){ var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:170,bitfield:9,buffer:39,events:43,inherits:129,"simple-sha1":163}],170:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":171,"./lib/encode":173,dup:15}],171:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":172,buffer:39,dup:16}],172:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],173:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],174:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],175:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){ if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":178}],177:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){ -this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.1",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.2",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Sun, 4 Oct 2015 20:09:15 -0400 Subject: [PATCH 098/109] tests use cross-spawn-async instead of child_process.spawn This allows Windows to run the tests, as promised in https://github.com/feross/webtorrent/issues/429#issuecomment-146061289 Note that there are a couple of outstanding failures on Windows: # client.seed: filesystem path to folder with one file, string not ok 8 should be equal --- operator: equal expected: '3a686c32404af0a66913dd5f8d2b40673f8d4490' actual: 'e6887b78d89d995876c7cef3476b6fb32c4c4e3d' ... not ok 9 should be equal --- operator: equal expected: |- 'magnet:?xt=urn:btih:3a686c32404af0a66913dd5f8d2b40673f8d4490&dn=folder&tr=udp%3A%2F%2Ftracker.webtorrent.io%3A80' actual: |- 'magnet:?xt=urn:btih:e6887b78d89d995876c7cef3476b6fb32c4c4e3d&dn=folder&tr=udp%3A%2F%2Ftracker.webtorrent.io%3A80' --- bin/test.js | 6 +++--- package.json | 1 + test/cmd.js | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/test.js b/bin/test.js index 2fc368b9..2675c80b 100644 --- a/bin/test.js +++ b/bin/test.js @@ -1,14 +1,14 @@ #!/usr/bin/env node -var cp = require('child_process') +var spawn = require('cross-spawn-async') var runBrowserTests = !process.env.TRAVIS_PULL_REQUEST || process.env.TRAVIS_PULL_REQUEST === 'false' -var node = cp.spawn('npm', ['run', 'test-node'], { stdio: 'inherit' }) +var node = spawn('npm', ['run', 'test-node'], { stdio: 'inherit' }) node.on('close', function (code) { if (code === 0 && runBrowserTests) { - var browser = cp.spawn('npm', ['run', 'test-browser'], { stdio: 'inherit' }) + var browser = spawn('npm', ['run', 'test-browser'], { stdio: 'inherit' }) browser.on('close', function (code) { process.exit(code) }) diff --git a/package.json b/package.json index a14cf99b..25f4e3dd 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "chunk-store-stream": "^2.0.0", "clivas": "^0.2.0", "create-torrent": "^3.4.0", + "cross-spawn-async": "^2.0.0", "debug": "^2.1.0", "end-of-stream": "^1.0.0", "executable": "^1.1.0", diff --git a/test/cmd.js b/test/cmd.js index abba4c26..ee8a87b9 100644 --- a/test/cmd.js +++ b/test/cmd.js @@ -1,4 +1,5 @@ var cp = require('child_process') +var spawn = require('cross-spawn-async') var path = require('path') var fs = require('fs') var parseTorrent = require('parse-torrent') @@ -84,7 +85,7 @@ test('Command line: webtorrent create /path/to/file', function (t) { var leavesPath = path.resolve(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub') - var child = cp.spawn('node', [ CMD_PATH, 'create', leavesPath ]) + var child = spawn('node', [ CMD_PATH, 'create', leavesPath ]) child.on('error', function (err) { t.fail(err) }) var chunks = [] From 3fb01552165cde84f40221a76bc779004c545f59 Mon Sep 17 00:00:00 2001 From: Joseph Frazier Date: Tue, 6 Oct 2015 23:42:54 -0400 Subject: [PATCH 099/109] echo "*.txt text eol=lf" >> .gitattributes This forces Windows checkouts to keep LF line endings for test files. https://help.github.com/articles/dealing-with-line-endings/#example resolves https://github.com/feross/webtorrent/issues/429 --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..f9e337fe --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.txt text eol=lf From b98fa9e99bc9a8658f1c2422fb1ff658906c9403 Mon Sep 17 00:00:00 2001 From: Lucas Pelegrino Date: Thu, 8 Oct 2015 22:56:58 -0400 Subject: [PATCH 100/109] Updated README.md to include events more events --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 8df1429c..393a8d65 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,35 @@ client.add(magnetUri, function (torrent) { }) ``` +#### `torrent.on('done', function () {})` + +Emitted when all the torrent's files have been downloaded + +Here is a usage example: + +```js +torrent.on('done', function(){ + console.log('torrent finished downloading'); + torrent.files.forEach(function(file){ + // do something with file + }) +}) +``` + +#### `torrent.on('download', function (chunkSize) {})` + +Emitted every time a new chunk of data arrives, it's useful for reporting the current torrent status, for instance: + +```js +torrent.on('download', function(chunkSize){ + console.log('chunk size: ' + chunkSize); + console.log('total downloaded: ' + torrent.downloaded); + console.log('download speed: ' + torrent.downloadSpeed()); + console.log('progress: ' + torrent.progress); + console.log('======'); +}) +``` + #### `torrent.on('wire', function (wire) {})` Emitted whenever a new peer is connected for this torrent. `wire` is an instance of From 8d4bdda551146d24fdba6ab2e4745d5afdc3e788 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 23 Oct 2015 17:42:05 -0700 Subject: [PATCH 101/109] "browser" field fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 25f4e3dd..cbdc61c7 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "webtorrent": "./bin/cmd.js" }, "browser": { - "./lib/server": false, + "./lib/server.js": false, "bittorrent-dht/client": false, "fs-chunk-store": "memory-chunk-store", "load-ip-set": false, From d2e563e11222face2ef5ccbfdd4952a71c3f8e13 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 23 Oct 2015 17:43:02 -0700 Subject: [PATCH 102/109] 0.62.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cbdc61c7..db770bc8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "webtorrent", "description": "Streaming torrent client", - "version": "0.62.2", + "version": "0.62.3", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", From 6a7e4e5ca07afdd770f347ba0c7b5f24d35f9c58 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 23 Oct 2015 17:43:17 -0700 Subject: [PATCH 103/109] build --- webtorrent.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 076a5b7f..6842e4a6 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -8,5 +8,5 @@ return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function() "application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-nzb":["nzb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-research-info-systems":["ris"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp4":["mp4a","m4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/opentype":["otf"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-mrsid-image":["sid"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/sgml":["sgml","sgm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["markdown","md","mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-pascal":["p","pas"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],134:[function(e,t,r){t.exports=a;var i=e("inherits");var n=e("stream");i(a,n.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);n.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=typeof e==="function"?e:e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained||!this._current)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();if(typeof this._queue!=="function"){this._queue.forEach(function(e){if(e.destroy)e.destroy()})}if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;e._current=null;if(typeof e._queue==="function"){e._queue(function(t,r){if(t)return e.destroy(t);e._gotNextStream(s(r))})}else{var t=e._queue.shift();if(typeof t==="function")t=s(t());e._gotNextStream(t)}};a.prototype._gotNextStream=function(e){var t=this;if(!e){t.push(null);t.destroy();return}t._current=e;t._forward();e.on("readable",r);e.on("end",n);e.on("error",a);e.on("close",i);function r(){t._forward()}function i(){if(!e._readableState.ended){t.destroy()}}function n(){t._current=null;e.removeListener("readable",r);e.removeListener("end",n);e.removeListener("error",a);e.removeListener("close",i);t._next()}function a(e){t.destroy(e)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new n.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:129,stream:67}],135:[function(e,t,r){(function(r){t.exports=f;t.exports.remote=u;var i=e("dezalgo");var n=e("fs");var a=e("simple-get");var s=e("magnet-uri");var o=e("parse-torrent-file");t.exports.toMagnetURI=s.encode;t.exports.toTorrentFile=o.encode;function f(e){if(typeof e==="string"&&/magnet:/.test(e)){return s(e)}else if(typeof e==="string"&&(/^[a-f0-9]{40}$/i.test(e)||/^[a-z2-7]{32}$/i.test(e))){return s("magnet:?xt=urn:btih:"+e)}else if(r.isBuffer(e)&&e.length===20){return s("magnet:?xt=urn:btih:"+e.toString("hex"))}else if(r.isBuffer(e)){return o(e)}else if(e&&e.infoHash){if(!e.announce)e.announce=[];if(typeof e.announce==="string"){e.announce=[e.announce]}return e}else{throw new Error("Invalid torrent identifier")}}function u(e,t){var r;if(typeof t!=="function")throw new Error("second argument must be a Function");t=i(t);try{r=f(e)}catch(s){}if(r&&r.infoHash){t(null,r)}else if(typeof a==="function"&&/^https?:/.test(e)){a.concat({url:e,headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e){e=new Error("Error downloading torrent: "+e.message);return t(e)}o(r)})}else if(typeof n.readFile==="function"&&typeof e==="string"){n.readFile(e,function(e,r){if(e)return t(new Error("Invalid torrent identifier"));o(r)})}else{t(new Error("Invalid torrent identifier"))}function o(e){try{r=f(e)}catch(i){return t(i)}if(r&&r.infoHash)t(null,r);else t(new Error("Invalid torrent identifier"))}}}).call(this,{isBuffer:e("/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")})},{"/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":45,dezalgo:136,fs:37,"magnet-uri":140,"parse-torrent-file":143,"simple-get":160}],136:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:137,dup:19,wrappy:139}],137:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":138,dup:20}],138:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],139:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],140:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var i=e("thirty-two");var n=e("xtend");var a=e("uniq");function s(e){var t={};var n=e.split("magnet:?")[1];var s=n&&n.length>=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":141,uniq:168,xtend:181}],141:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":142}],142:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],143:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":124,fs:37,once:151}],150:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],151:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:150}],152:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],153:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],154:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],155:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:156}],156:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:157,dup:19,wrappy:159}],157:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":158,dup:20}],158:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],159:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],160:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:68,https:44,once:162,"unzip-response":38,url:78,xtend:181}],161:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],162:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:161}],163:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:164}],164:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){ var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:170,bitfield:9,buffer:39,events:43,inherits:129,"simple-sha1":163}],170:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":171,"./lib/encode":173,dup:15}],171:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":172,buffer:39,dup:16}],172:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],173:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],174:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],175:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){ if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":178}],177:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){ -this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.2",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.3",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server.js":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Fri, 23 Oct 2015 17:44:01 -0700 Subject: [PATCH 104/109] build --- webtorrent.min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webtorrent.min.js b/webtorrent.min.js index 6842e4a6..1eca01ae 100644 --- a/webtorrent.min.js +++ b/webtorrent.min.js @@ -8,5 +8,5 @@ return}t.onload=function(){e._offset=i;e.push(s(t.result))};t.onerror=function() "application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-nzb":["nzb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-research-info-systems":["ris"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp4":["mp4a","m4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/opentype":["otf"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-mrsid-image":["sid"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/sgml":["sgml","sgm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["markdown","md","mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-pascal":["p","pas"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],134:[function(e,t,r){t.exports=a;var i=e("inherits");var n=e("stream");i(a,n.Readable);function a(e,t){if(!(this instanceof a))return new a(e,t);n.Readable.call(this,t);this.destroyed=false;this._drained=false;this._forwarding=false;this._current=null;this._queue=typeof e==="function"?e:e.map(s);this._next()}a.obj=function(e){return new a(e,{objectMode:true,highWaterMark:16})};a.prototype._read=function(){this._drained=true;this._forward()};a.prototype._forward=function(){if(this._forwarding||!this._drained||!this._current)return;this._forwarding=true;var e;while((e=this._current.read())!==null){this._drained=this.push(e)}this._forwarding=false};a.prototype.destroy=function(e){if(this.destroyed)return;this.destroyed=true;if(this._current&&this._current.destroy)this._current.destroy();if(typeof this._queue!=="function"){this._queue.forEach(function(e){if(e.destroy)e.destroy()})}if(e)this.emit("error",e);this.emit("close")};a.prototype._next=function(){var e=this;e._current=null;if(typeof e._queue==="function"){e._queue(function(t,r){if(t)return e.destroy(t);e._gotNextStream(s(r))})}else{var t=e._queue.shift();if(typeof t==="function")t=s(t());e._gotNextStream(t)}};a.prototype._gotNextStream=function(e){var t=this;if(!e){t.push(null);t.destroy();return}t._current=e;t._forward();e.on("readable",r);e.on("end",n);e.on("error",a);e.on("close",i);function r(){t._forward()}function i(){if(!e._readableState.ended){t.destroy()}}function n(){t._current=null;e.removeListener("readable",r);e.removeListener("end",n);e.removeListener("error",a);e.removeListener("close",i);t._next()}function a(e){t.destroy(e)}};function s(e){if(!e||typeof e==="function"||e._readableState)return e;var t=(new n.Readable).wrap(e);if(e.destroy){t.destroy=e.destroy.bind(e)}return t}},{inherits:129,stream:67}],135:[function(e,t,r){(function(r){t.exports=f;t.exports.remote=u;var i=e("dezalgo");var n=e("fs");var a=e("simple-get");var s=e("magnet-uri");var o=e("parse-torrent-file");t.exports.toMagnetURI=s.encode;t.exports.toTorrentFile=o.encode;function f(e){if(typeof e==="string"&&/magnet:/.test(e)){return s(e)}else if(typeof e==="string"&&(/^[a-f0-9]{40}$/i.test(e)||/^[a-z2-7]{32}$/i.test(e))){return s("magnet:?xt=urn:btih:"+e)}else if(r.isBuffer(e)&&e.length===20){return s("magnet:?xt=urn:btih:"+e.toString("hex"))}else if(r.isBuffer(e)){return o(e)}else if(e&&e.infoHash){if(!e.announce)e.announce=[];if(typeof e.announce==="string"){e.announce=[e.announce]}return e}else{throw new Error("Invalid torrent identifier")}}function u(e,t){var r;if(typeof t!=="function")throw new Error("second argument must be a Function");t=i(t);try{r=f(e)}catch(s){}if(r&&r.infoHash){t(null,r)}else if(typeof a==="function"&&/^https?:/.test(e)){a.concat({url:e,headers:{"user-agent":"WebTorrent (http://webtorrent.io)"}},function(e,r){if(e){e=new Error("Error downloading torrent: "+e.message);return t(e)}o(r)})}else if(typeof n.readFile==="function"&&typeof e==="string"){n.readFile(e,function(e,r){if(e)return t(new Error("Invalid torrent identifier"));o(r)})}else{t(new Error("Invalid torrent identifier"))}function o(e){try{r=f(e)}catch(i){return t(i)}if(r&&r.infoHash)t(null,r);else t(new Error("Invalid torrent identifier"))}}}).call(this,{isBuffer:e("/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")})},{"/Users/feross/code/webtorrent/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":45,dezalgo:136,fs:37,"magnet-uri":140,"parse-torrent-file":143,"simple-get":160}],136:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:137,dup:19,wrappy:139}],137:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":138,dup:20}],138:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],139:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],140:[function(e,t,r){(function(r){t.exports=s;t.exports.decode=s;t.exports.encode=o;var i=e("thirty-two");var n=e("xtend");var a=e("uniq");function s(e){var t={};var n=e.split("magnet:?")[1];var s=n&&n.length>=0?n.split("&"):[];s.forEach(function(e){var r=e.split("=");if(r.length!==2)return;var i=r[0];var n=r[1];if(i==="dn")n=decodeURIComponent(n).replace(/\+/g," ");if(i==="tr"||i==="xs"||i==="as"||i==="ws"){n=decodeURIComponent(n)}if(i==="kt")n=decodeURIComponent(n).split("+");if(t[i]){if(Array.isArray(t[i])){t[i].push(n)}else{var a=t[i];t[i]=[a,n]}}else{t[i]=n}});var o;if(t.xt){var f=Array.isArray(t.xt)?t.xt:[t.xt];f.forEach(function(e){if(o=e.match(/^urn:btih:(.{40})/)){t.infoHash=new r(o[1],"hex").toString("hex")}else if(o=e.match(/^urn:btih:(.{32})/)){var n=i.decode(o[1]);t.infoHash=new r(n,"binary").toString("hex")}})}if(t.dn)t.name=t.dn;if(t.kt)t.keywords=t.kt;if(typeof t.tr==="string")t.announce=[t.tr];else if(Array.isArray(t.tr))t.announce=t.tr;else t.announce=[];a(t.announce);t.urlList=[];if(typeof t.as==="string"||Array.isArray(t.as)){t.urlList=t.urlList.concat(t.as)}if(typeof t.ws==="string"||Array.isArray(t.ws)){t.urlList=t.urlList.concat(t.ws)}return t}function o(e){e=n(e);if(e.infoHash)e.xt="urn:btih:"+e.infoHash;if(e.name)e.dn=e.name;if(e.keywords)e.kt=e.keywords;if(e.announce)e.tr=e.announce;if(e.urlList){e.ws=e.urlList;delete e.as}var t="magnet:?";Object.keys(e).filter(function(e){return e.length===2}).forEach(function(r,i){var n=Array.isArray(e[r])?e[r]:[e[r]];n.forEach(function(e,n){if((i>0||n>0)&&(r!=="kt"||n===0))t+="&";if(r==="dn")e=encodeURIComponent(e).replace(/%20/g,"+");if(r==="tr"||r==="xs"||r==="as"||r==="ws"){e=encodeURIComponent(e)}if(r==="kt")e=encodeURIComponent(e);if(r==="kt"&&n>0)t+="+"+e;else t+=r+"="+e})});return t}}).call(this,e("buffer").Buffer)},{buffer:39,"thirty-two":141,uniq:168,xtend:181}],141:[function(e,t,r){var i=e("./thirty-two");r.encode=i.encode;r.decode=i.decode},{"./thirty-two":142}],142:[function(e,t,r){(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";var i=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];function n(e){var t=Math.floor(e.length/5);return e.length%5==0?t:t+1}r.encode=function(r){var i=0;var a=0;var s=0;var o=0;var f=new e(n(r)*8);if(!e.isBuffer(r)){r=new e(r)}while(i3){o=u&255>>s;s=(s+5)%8;o=o<>8-s;i++}else{o=u>>8-(s+5)&31;s=(s+5)%8;if(s==0)i++}f[a]=t.charCodeAt(o);a++}for(i=a;i>>r;o[s]=a;s++;a=255&n<<8-r}}else{throw new Error("Invalid input - it is not base32 encoded string")}}return o.slice(0,s)}}).call(this,e("buffer").Buffer)},{buffer:39}],143:[function(e,t,r){(function(r){t.exports=o;t.exports.decode=o;t.exports.encode=f;var i=e("bencode");var n=e("path");var a=e("simple-sha1");var s=e("uniq");function o(e){if(r.isBuffer(e)){e=i.decode(e)}c(e.info,"info");c(e.info["name.utf-8"]||e.info.name,"info.name");c(e.info["piece length"],"info['piece length']");c(e.info.pieces,"info.pieces");if(e.info.files){e.info.files.forEach(function(e){c(typeof e.length==="number","info.files[0].length");c(e["path.utf-8"]||e.path,"info.files[0].path")})}else{c(typeof e.info.length==="number","info.length")}var t={};t.info=e.info;t.infoBuffer=i.encode(e.info);t.infoHash=a.sync(t.infoBuffer);t.name=(e.info["name.utf-8"]||e.info.name).toString();if(e.info.private!==undefined)t.private=!!e.info.private;if(e["creation date"])t.created=new Date(e["creation date"]*1e3);if(e["created by"])t.createdBy=e["created by"].toString();if(r.isBuffer(e.comment))t.comment=e.comment.toString();t.announce=[];if(e["announce-list"]&&e["announce-list"].length){e["announce-list"].forEach(function(e){e.forEach(function(e){t.announce.push(e.toString())})})}else if(e.announce){t.announce.push(e.announce.toString())}s(t.announce);if(r.isBuffer(e["url-list"])){e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]}t.urlList=(e["url-list"]||[]).map(function(e){return e.toString()});var o=e.info.files||[e.info];t.files=o.map(function(e,r){var i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map(function(e){return e.toString()});return{path:n.join.apply(null,[n.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:o.slice(0,r).reduce(u,0)}});t.length=o.reduce(u,0);var f=t.files[t.files.length-1];t.pieceLength=e.info["piece length"];t.lastPieceLength=(f.offset+f.length)%t.pieceLength||t.pieceLength;t.pieces=l(e.info.pieces);return t}function f(e){var t={info:e.info};t["announce-list"]=e.announce.map(function(e){if(!t.announce)t.announce=e;e=new r(e,"utf8");return[e]});if(e.created){t["creation date"]=e.created.getTime()/1e3|0}if(e.urlList){t["url-list"]=e.urlList}return i.encode(t)}function u(e,t){return e+t.length}function l(e){var t=[];for(var r=0;r0;return l(n,s,o,function(e){if(!r)r=e;if(e)i.forEach(c);if(s)return;i.forEach(c);t(r)})});return e.reduce(p)};t.exports=d},{"end-of-stream":124,fs:37,once:151}],150:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],151:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:150}],152:[function(e,t,r){var i=function(e){var t=0;return function(){if(t===e.length)return null;var r=e.length-t;var i=Math.random()*r|0;var n=e[t+i];var a=e[t];e[t]=n;e[t+i]=a;t++;return n}};t.exports=i},{}],153:[function(e,t,r){t.exports=function(e,t){var r=true;var i=t.indexOf("=");if(-1==i)return-2;var n=t.slice(i+1).split(",").map(function(t){var t=t.split("-"),i=parseInt(t[0],10),n=parseInt(t[1],10);if(isNaN(i)){i=e-n;n=e-1}else if(isNaN(n)){n=e-1}if(n>e-1)n=e-1;if(isNaN(i)||isNaN(n)||i>n||i<0)r=false;return{start:i,end:n}});n.type=t.slice(0,i);return r?n:-1}},{}],154:[function(e,t,r){t.exports=n;t.exports.filter=a;var i=e("events").EventEmitter;function n(e,t,r){if(!Array.isArray(r))r=[r];var i=[];r.forEach(function(r){var n=function(){var e=[].slice.call(arguments);e.unshift(r);t.emit.apply(t,e)};i.push(n);e.on(r,n)});return function n(){r.forEach(function(t,r){e.removeListener(t,i[r])})}}function a(e,t){var r=new i;n(e,r,t);return r}},{events:43}],155:[function(e,t,r){var i=e("dezalgo");t.exports=function(e,t){if(t)t=i(t);var r,n,a;if(Array.isArray(e)){r=[];n=e.length}else{a=Object.keys(e);r={};n=a.length}function s(e,i,a){r[e]=a;if(--n===0||i){if(t)t(i,r);t=null}}if(!n){if(t)t(null,r);t=null}else if(a){a.forEach(function(t){e[t](s.bind(undefined,t))})}else{e.forEach(function(e,t){e(s.bind(undefined,t))})}}},{dezalgo:156}],156:[function(e,t,r){arguments[4][19][0].apply(r,arguments)},{asap:157,dup:19,wrappy:159}],157:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{"./raw":158,dup:20}],158:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],159:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],160:[function(e,t,r){(function(r){t.exports=u;var i=e("xtend");var n=e("http");var a=e("https");var s=e("once");var o=e("unzip-response");var f=e("url");function u(e,t){e=typeof e==="string"?{url:e}:i(e);t=s(t);if(e.url)l(e);if(e.headers==null)e.headers={};if(e.maxRedirects==null)e.maxRedirects=10;var r=e.body;e.body=undefined;if(r&&!e.method)e.method="POST";var f=Object.keys(e.headers).some(function(e){return e.toLowerCase()==="accept-encoding"});if(!f)e.headers["accept-encoding"]="gzip, deflate";var c=e.protocol==="https:"?a:n;var p=c.request(e,function(r){if(r.statusCode>=300&&r.statusCode<400&&"location"in r.headers){e.url=r.headers.location;l(e);r.resume();e.maxRedirects-=1;if(e.maxRedirects>0)u(e,t);else t(new Error("too many redirects"));return}t(null,typeof o==="function"?o(r):r)});p.on("error",t);p.end(r);return p}t.exports.concat=function(e,t){return u(e,function(e,i){if(e)return t(e);var n=[];i.on("data",function(e){n.push(e)});i.on("end",function(){t(null,r.concat(n),i)})})};["get","post","put","patch","head","delete"].forEach(function(e){t.exports[e]=function(t,r){if(typeof t==="string")t={url:t};t.method=e.toUpperCase();return u(t,r)}});function l(e){var t=f.parse(e.url);if(t.hostname)e.hostname=t.hostname;if(t.port)e.port=t.port;if(t.protocol)e.protocol=t.protocol;e.path=t.path;delete e.url}}).call(this,e("buffer").Buffer)},{buffer:39,http:68,https:44,once:162,"unzip-response":38,url:78,xtend:181}],161:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],162:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{dup:29,wrappy:161}],163:[function(e,t,r){var i=e("rusha");var n=new i;var a=window.crypto||window.msCrypto||{};var s=a.subtle||a.webkitSubtle;var o=n.digest.bind(n);try{s.digest({name:"sha-1"},new Uint8Array).catch(function(){s=false})}catch(f){s=false}function u(e,t){if(!s){setTimeout(t,0,o(e));return}if(typeof e==="string"){e=l(e)}s.digest({name:"sha-1"},e).then(function r(e){t(c(new Uint8Array(e)))},function i(r){t(o(e))})}function l(e){var t=e.length;var r=new Uint8Array(t);for(var i=0;i>>4).toString(16));r.push((n&15).toString(16))}return r.join("")}t.exports=u;t.exports.sync=o},{rusha:164}],164:[function(e,t,r){(function(e){(function(){var r={getDataType:function(t){if(typeof t==="string"){return"string"}if(t instanceof Array){return"array"}if(typeof e!=="undefined"&&e.Buffer&&e.Buffer.isBuffer(t)){return"buffer"}if(t instanceof ArrayBuffer){return"arraybuffer"}if(t.buffer instanceof ArrayBuffer){return"view"}if(t instanceof Blob){return"blob"}throw new Error("Unsupported data type.")}};function i(e){"use strict";var t={fill:0};var a=function(e){for(e+=9;e%64>0;e+=1);return e};var s=function(e,t){for(var r=t>>2;r>2]|=128<<24-(t%4<<3);e[((t>>2)+2&~15)+14]=r>>29;e[((t>>2)+2&~15)+15]=r<<3};var f=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a.charCodeAt(r);case 1:e[n+2|0]=a.charCodeAt(r+1);case 2:e[n+1|0]=a.charCodeAt(r+2);case 3:e[n|0]=a.charCodeAt(r+3)}}for(s=o;s>2]=a.charCodeAt(r+s)<<24|a.charCodeAt(r+s+1)<<16|a.charCodeAt(r+s+2)<<8|a.charCodeAt(r+s+3)}switch(f){case 3:e[n+u+1|0]=a.charCodeAt(r+u+2);case 2:e[n+u+2|0]=a.charCodeAt(r+u+1);case 1:e[n+u+3|0]=a.charCodeAt(r+u)}};var u=function(e,t,r,i,n){var a=this,s,o=n%4,f=i%4,u=i-f;if(u>0){switch(o){case 0:e[n+3|0]=a[r];case 1:e[n+2|0]=a[r+1];case 2:e[n+1|0]=a[r+2];case 3:e[n|0]=a[r+3]}}for(s=4-o;s>2]=a[r+s]<<24|a[r+s+1]<<16|a[r+s+2]<<8|a[r+s+3]}switch(f){case 3:e[n+u+1|0]=a[r+u+2];case 2:e[n+u+2|0]=a[r+u+1];case 1:e[n+u+3|0]=a[r+u]}};var l=function(e,t,r,i,a){var s=this,o,f=a%4,u=i%4,l=i-u;var c=new Uint8Array(n.readAsArrayBuffer(s.slice(r,r+i)));if(l>0){switch(f){case 0:e[a+3|0]=c[0];case 1:e[a+2|0]=c[1];case 2:e[a+1|0]=c[2];case 3:e[a|0]=c[3]}}for(o=4-f;o>2]=c[o]<<24|c[o+1]<<16|c[o+2]<<8|c[o+3]}switch(u){case 3:e[a+l+1|0]=c[l+2];case 2:e[a+l+2|0]=c[l+1];case 1:e[a+l+3|0]=c[l]}};var c=function(e){switch(r.getDataType(e)){case"string":return f.bind(e);case"array":return u.bind(e);case"buffer":return u.bind(e);case"arraybuffer":return u.bind(new Uint8Array(e));case"view":return u.bind(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));case"blob":return l.bind(e)}};var p=function(e,t){switch(r.getDataType(e)){case"string":return e.slice(t);case"array":return e.slice(t);case"buffer":return e.slice(t);case"arraybuffer":return e.slice(t);case"view":return e.buffer.slice(t)}};var d=function(e){var t,r,i="0123456789abcdef",n=[],a=new Uint8Array(e);for(t=0;t>4&15)+i.charAt(r>>0&15)}return n.join("")};var h=function(e){var t;if(e<=65536)return 65536;if(e<16777216){for(t=1;t0){throw new Error("Chunk size must be a multiple of 128 bit")}t.maxChunkLen=e;t.padMaxChunkLen=a(e);t.heap=new ArrayBuffer(h(t.padMaxChunkLen+320+20));t.h32=new Int32Array(t.heap);t.h8=new Int8Array(t.heap);t.core=new i._core({Int32Array:Int32Array,DataView:DataView},{},t.heap);t.buffer=null};m(e||64*1024);var v=function(e,t){var r=new Int32Array(e,t+320,5);r[0]=1732584193;r[1]=-271733879;r[2]=-1732584194;r[3]=271733878;r[4]=-1009589776};var g=function(e,r){var i=a(e);var n=new Int32Array(t.heap,0,i>>2);s(n,e);o(n,e,r);return i};var y=function(e,r,i){c(e)(t.h8,t.h32,r,i,0)};var _=function(e,r,i,n,a){var s=i;if(a){s=g(i,n)}y(e,r,i);t.core.hash(s,t.padMaxChunkLen)};var b=function(e,t){var r=new Int32Array(e,t+320,5);var i=new Int32Array(5);var n=new DataView(i.buffer);n.setInt32(0,r[0],false);n.setInt32(4,r[1],false);n.setInt32(8,r[2],false);n.setInt32(12,r[3],false);n.setInt32(16,r[4],false);return i};var w=this.rawDigest=function(e){var r=e.byteLength||e.length||e.size||0;v(t.heap,t.padMaxChunkLen);var i=0,n=t.maxChunkLen,a;for(i=0;r>i+n;i+=n){_(e,i,n,r,false)}_(e,i,r-i,r,true);return b(t.heap,t.padMaxChunkLen)};this.digest=this.digestFromString=this.digestFromBuffer=this.digestFromArrayBuffer=function(e){return d(w(e).buffer)}}i._core=function s(e,t,r){"use asm";var i=new e.Int32Array(r);function n(e,t){e=e|0;t=t|0;var r=0,n=0,a=0,s=0,o=0,f=0,u=0,l=0,c=0,p=0,d=0,h=0,m=0,v=0;a=i[t+320>>2]|0;o=i[t+324>>2]|0;u=i[t+328>>2]|0;c=i[t+332>>2]|0;d=i[t+336>>2]|0;for(r=0;(r|0)<(e|0);r=r+64|0){s=a;f=o;l=u;p=c;h=d;for(n=0;(n|0)<64;n=n+4|0){v=i[r+n>>2]|0;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[e+n>>2]=v}for(n=e+64|0;(n|0)<(e+80|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|~o&c)|0)+((v+d|0)+1518500249|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+80|0;(n|0)<(e+160|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)+1859775393|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+160|0;(n|0)<(e+240|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o&u|o&c|u&c)|0)+((v+d|0)-1894007588|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}for(n=e+240|0;(n|0)<(e+320|0);n=n+4|0){v=(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])<<1|(i[n-12>>2]^i[n-32>>2]^i[n-56>>2]^i[n-64>>2])>>>31;m=((a<<5|a>>>27)+(o^u^c)|0)+((v+d|0)-899497514|0)|0;d=c;c=u;u=o<<30|o>>>2;o=a;a=m;i[n>>2]=v}a=a+s|0;o=o+f|0;u=u+l|0;c=c+p|0;d=d+h|0}i[t+320>>2]=a;i[t+324>>2]=o;i[t+328>>2]=u;i[t+332>>2]=c;i[t+336>>2]=d}return{hash:n}};if(typeof t!=="undefined"){t.exports=i}else if(typeof window!=="undefined"){window.Rusha=i}if(typeof FileReaderSync!=="undefined"){var n=new FileReaderSync,a=new i(4*1024*1024);self.onmessage=function o(e){var t,r=e.data.data;try{t=a.digest(r);self.postMessage({id:e.data.id,hash:t})}catch(i){self.postMessage({id:e.data.id,error:i.name})}}}})()}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(e,t,r){var i=1;var n=65535;var a=4;var s=function(){i=i+1&n};var o=setInterval(s,1e3/a|0);if(o.unref)o.unref();t.exports=function(e){ var t=a*(e||5);var r=[0];var s=1;var o=i-1&n;return function(e){var f=i-o&n;if(f>t)f=t;o=i;while(f--){if(s===t)s=0;r[s]=r[s===0?t-1:s-1];s++}if(e)r[s-1]+=e;var u=r[s-1];var l=r.lengthf){return this.emit("warning",new Error("Peer gave maliciously large metadata size"))}this._metadataSize=e.metadata_size;this._numPieces=Math.ceil(this._metadataSize/l);this._remainingRejects=this._numPieces*2;if(this._fetching){this._requestPieces()}};t.prototype.onMessage=function(e){var t,r;try{var n=e.toString();var a=n.indexOf("ee")+2;t=i.decode(n.substring(0,a));r=e.slice(a)}catch(s){return}switch(t.msg_type){case 0:this._onRequest(t.piece);break;case 1:this._onData(t.piece,r,t.total_size);break;case 2:this._onReject(t.piece);break}};t.prototype.fetch=function(){if(this._metadataComplete){return}this._fetching=true;if(this._metadataSize){this._requestPieces()}};t.prototype.cancel=function(){this._fetching=false};t.prototype.setMetadata=function(e){if(this._metadataComplete)return true;try{var t=i.decode(e).info;if(t){e=i.encode(t)}}catch(r){}if(this._infoHashHex&&this._infoHashHex!==o.sync(e)){return false}this.cancel();this.metadata=e;this._metadataComplete=true;this._metadataSize=this.metadata.length;this._wire.extendedHandshake.metadata_size=this._metadataSize;this.emit("metadata",i.encode({info:i.decode(this.metadata)}));return true};t.prototype._send=function(e,t){var n=i.encode(e);if(r.isBuffer(t)){n=r.concat([n,t])}this._wire.extended("ut_metadata",n)};t.prototype._request=function(e){this._send({msg_type:0,piece:e})};t.prototype._data=function(e,t,r){var i={msg_type:1,piece:e};if(typeof r==="number"){i.total_size=r}this._send(i,t)};t.prototype._reject=function(e){this._send({msg_type:2,piece:e})};t.prototype._onRequest=function(e){if(!this._metadataComplete){this._reject(e);return}var t=e*l;var r=t+l;if(r>this._metadataSize){r=this._metadataSize}var i=this.metadata.slice(t,r);this._data(e,i,this._metadataSize)};t.prototype._onData=function(e,t,r){if(t.length>l){return}t.copy(this.metadata,e*l);this._bitfield.set(e);this._checkDone()};t.prototype._onReject=function(e){if(this._remainingRejects>0&&this._fetching){this._request(e);this._remainingRejects-=1}else{this.emit("warning",new Error('Peer sent "reject" too much'))}};t.prototype._requestPieces=function(){this.metadata=new r(this._metadataSize);for(var e=0;e0){this._requestPieces()}else{this.emit("warning",new Error("Peer sent invalid metadata"))}};return t}}).call(this,e("buffer").Buffer)},{bencode:170,bitfield:9,buffer:39,events:43,inherits:129,"simple-sha1":163}],170:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./lib/decode":171,"./lib/encode":173,dup:15}],171:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{"./dict":172,buffer:39,dup:16}],172:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{dup:17}],173:[function(e,t,r){arguments[4][18][0].apply(r,arguments)},{buffer:39,dup:18}],174:[function(e,t,r){var i=function(e,t,r){this._byteOffset=t||0;if(e instanceof ArrayBuffer){this.buffer=e}else if(typeof e=="object"){this.dataView=e;if(t){this._byteOffset+=t}}else{this.buffer=new ArrayBuffer(e||0)}this.position=0;this.endianness=r==null?i.LITTLE_ENDIAN:r};t.exports=i;i.prototype={};i.prototype.save=function(e){var t=new Blob([this.buffer]);var r=window.webkitURL||window.URL;if(r&&r.createObjectURL){var i=r.createObjectURL(t);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click();r.revokeObjectURL(i)}else{throw"DataStream.save: Can't create object URL."}};i.BIG_ENDIAN=false;i.LITTLE_ENDIAN=true;i.prototype._dynamicSize=true;Object.defineProperty(i.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){if(!e){this._trimAlloc()}this._dynamicSize=e}});i.prototype._byteLength=0;Object.defineProperty(i.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}});Object.defineProperty(i.prototype,"buffer",{get:function(){this._trimAlloc();return this._buffer},set:function(e){this._buffer=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._buffer.byteLength}});Object.defineProperty(i.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset;this._buffer=e.buffer;this._dataView=new DataView(this._buffer,this._byteOffset);this._byteLength=this._byteOffset+e.byteLength}});i.prototype._realloc=function(e){if(!this._dynamicSize){return}var t=this._byteOffset+this.position+e;var r=this._buffer.byteLength;if(t<=r){if(t>this._byteLength){this._byteLength=t}return}if(r<1){r=1}while(t>r){r*=2}var i=new ArrayBuffer(r);var n=new Uint8Array(this._buffer);var a=new Uint8Array(i,0,n.length);a.set(n);this.buffer=i;this._byteLength=t};i.prototype._trimAlloc=function(){if(this._byteLength==this._buffer.byteLength){return}var e=new ArrayBuffer(this._byteLength);var t=new Uint8Array(e);var r=new Uint8Array(this._buffer,0,t.length);t.set(r);this.buffer=e};i.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e);var r=new Uint8Array(t);var i=new Uint8Array(this._buffer,e,r.length);r.set(i);this.buffer=t;this.position-=e};i.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t};i.prototype.isEof=function(){return this.position>=this._byteLength};i.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var r=new Int32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var r=new Int16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var r=new Uint32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var r=new Uint16Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*2;return r};i.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);this.position+=e*1;return t};i.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var r=new Float64Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*8;return r};i.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var r=new Float32Array(this._buffer,this.byteOffset+this.position,e);i.arrayToNative(r,t==null?this.endianness:t);this.position+=e*4;return r};i.prototype.readInt32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Int32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Int16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readInt8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Int8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readUint32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Uint32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint16Array=function(e,t){e=e==null?this.byteLength-this.position/2:e;var r=new Uint16Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readUint8Array=function(e){e=e==null?this.byteLength-this.position:e;var t=new Uint8Array(e);i.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT);this.position+=t.byteLength;return t};i.prototype.readFloat64Array=function(e,t){e=e==null?this.byteLength-this.position/8:e;var r=new Float64Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.readFloat32Array=function(e,t){e=e==null?this.byteLength-this.position/4:e;var r=new Float32Array(e);i.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT);i.arrayToNative(r,t==null?this.endianness:t);this.position+=r.byteLength;return r};i.prototype.writeInt32Array=function(e,t){this._realloc(e.length*4);if(e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0){i.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength);this.mapInt32Array(e.length,t)}else{for(var r=0;r0;i.memcpy=function(e,t,r,i,n){var a=new Uint8Array(e,t,n);var s=new Uint8Array(r,i,n);a.set(s)};i.arrayToNative=function(e,t){if(t==this.endianness){return e}else{return this.flipArrayEndianness(e)}};i.nativeToEndian=function(e,t){if(this.endianness==t){return e}else{return this.flipArrayEndianness(e)}};i.flipArrayEndianness=function(e){var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);for(var r=0;rn;i--,n++){var a=t[n];t[n]=t[i];t[i]=a}}return e};i.prototype.failurePosition=0;i.prototype.readStruct=function(e){var t={},r,i,n;var a=this.position;for(var s=0;s>16);this.writeUint8((e&65280)>>8);this.writeUint8(e&255)};i.prototype.adjustUint32=function(e,t){var r=this.position;this.seek(e);this.writeUint32(t);this.seek(r)}},{}],175:[function(e,t,r){var n=e("./DataStream");var a=e("./descriptor");var s=e("./log");var o={ERR_NOT_ENOUGH_DATA:0,OK:1,boxCodes:["mdat","avcC","hvcC","ftyp","payl","vmhd","smhd","hmhd","dref","elst"],fullBoxCodes:["mvhd","tkhd","mdhd","hdlr","smhd","hmhd","nhmd","url ","urn ","ctts","cslg","stco","co64","stsc","stss","stsz","stz2","stts","stsh","mehd","trex","mfhd","tfhd","trun","tfdt","esds","subs","txtC"],containerBoxCodes:[["moov",["trak"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl"],["mvex",["trex"]],["moof",["traf"]],["traf",["trun"]],["vttc"],["tref"]],sampleEntryCodes:[{prefix:"Visual",types:["mp4v","avc1","avc2","avc3","avc4","avcp","drac","encv","mjp2","mvc1","mvc2","resv","s263","svc1","vc-1","hvc1","hev1"]},{prefix:"Audio",types:["mp4a","ac-3","alac","dra1","dtsc","dtse",,"dtsh","dtsl","ec-3","enca","g719","g726","m4ae","mlpa","raw ","samr","sawb","sawp","sevc","sqcp","ssmv","twos"]},{prefix:"Hint",types:["fdp ","m2ts","pm2t","prtp","rm2t","rrtp","rsrp","rtp ","sm2t","srtp"]},{prefix:"Metadata",types:["metx","mett","urim"]},{prefix:"Subtitle",types:["stpp","wvtt","sbtt","tx3g","stxt"]}],trackReferenceTypes:["scal"],initialize:function(){var e,t;var r;o.FullBox.prototype=new o.Box;o.ContainerBox.prototype=new o.Box;o.stsdBox.prototype=new o.FullBox;o.SampleEntry.prototype=new o.FullBox;o.TrackReferenceTypeBox.prototype=new o.Box;r=o.boxCodes.length;for(e=0;ee.byteLength){e.seek(i);s.w("BoxParser",'Not enough data in stream to parse the entire "'+f+'" box');return{code:o.ERR_NOT_ENOUGH_DATA,type:f,size:a,hdr_size:n}}if(o[f+"Box"]){r=new o[f+"Box"](a-n)}else{if(t){r=new o.SampleEntry(f,a-n)}else{r=new o.Box(f,a-n)}}r.hdr_size=n;r.start=i;r.fileStart=i+e.buffer.fileStart;r.parse(e);e.seek(i+a);return{code:o.OK,box:r,size:a}}};t.exports=o;o.initialize();o.Box.prototype.parse=function(e){ if(this.type!="mdat"){this.data=e.readUint8Array(this.size)}else{e.seek(this.start+this.size+this.hdr_size)}};o.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8();this.flags=e.readUint24();this.size-=4};o.ContainerBox.prototype.parse=function(e){var t;var r;var i;i=e.position;while(e.position=4){this.compatible_brands[t]=e.readString(4);this.size-=4;t++}};o.mvhdBox.prototype.parse=function(e){this.flags=0;this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.rate=e.readUint32();this.volume=e.readUint16()>>8;e.readUint16();e.readUint32Array(2);this.matrix=e.readUint32Array(9);e.readUint32Array(6);this.next_track_id=e.readUint32()};o.TKHD_FLAG_ENABLED=1;o.TKHD_FLAG_IN_MOVIE=2;o.TKHD_FLAG_IN_PREVIEW=4;o.tkhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.track_id=e.readUint32();e.readUint32();this.duration=e.readUint32()}e.readUint32Array(2);this.layer=e.readInt16();this.alternate_group=e.readInt16();this.volume=e.readInt16()>>8;e.readUint16();this.matrix=e.readInt32Array(9);this.width=e.readUint32();this.height=e.readUint32()};o.mdhdBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version==1){this.creation_time=e.readUint64();this.modification_time=e.readUint64();this.timescale=e.readUint32();this.duration=e.readUint64()}else{this.creation_time=e.readUint32();this.modification_time=e.readUint32();this.timescale=e.readUint32();this.duration=e.readUint32()}this.language=e.readUint16();var t=[];t[0]=this.language>>10&31;t[1]=this.language>>5&31;t[2]=this.language&31;this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96);e.readUint16()};o.hdlrBox.prototype.parse=function(e){this.parseFullHeader(e);if(this.version===0){e.readUint32();this.handler=e.readString(4);e.readUint32Array(3);this.name=e.readCString()}else{this.data=e.readUint8Array(size)}};o.stsdBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);r=e.readUint32();for(i=1;i<=r;i++){t=o.parseOneBox(e,true);this.entries.push(t.box)}};o.avcCBox.prototype.parse=function(e){var t;var r;var i;this.configurationVersion=e.readUint8();this.AVCProfileIndication=e.readUint8();this.profile_compatibility=e.readUint8();this.AVCLevelIndication=e.readUint8();this.lengthSizeMinusOne=e.readUint8()&3;r=e.readUint8()&31;this.size-=6;this.SPS=new Array(r);for(t=0;t0){this.ext=e.readUint8Array(this.size)}};o.hvcCBox.prototype.parse=function(e){var t;var r;var i;var n;this.configurationVersion=e.readUint8();n=e.readUint8();this.general_profile_space=n>>6;this.general_tier_flag=(n&32)>>5;this.general_profile_idc=n&31;this.general_profile_compatibility=e.readUint32();this.general_constraint_indicator=e.readUint8Array(6);this.general_level_idc=e.readUint8();this.min_spatial_segmentation_idc=e.readUint16()&4095;this.parallelismType=e.readUint8()&3;this.chromaFormat=e.readUint8()&3;this.bitDepthLumaMinus8=e.readUint8()&7;this.bitDepthChromaMinus8=e.readUint8()&7;this.avgFrameRate=e.readUint16();n=e.readUint8();this.constantFrameRate=n>>6;this.numTemporalLayers=(n&13)>>3;this.temporalIdNested=(n&4)>>2;this.lengthSizeMinusOne=n&3;this.nalu_arrays=[];numOfArrays=e.readUint8();for(t=0;t>7;a.nalu_type=n&63;numNalus=e.readUint16();for(j=0;j>=1}t+=f(i,0);t+=".";if(this.hvcC.general_tier_flag===0){t+="L"}else{t+="H"}t+=this.hvcC.general_level_idc;var n=false;var a="";for(e=5;e>=0;e--){if(this.hvcC.general_constraint_indicator[e]||n){a="."+f(this.hvcC.general_constraint_indicator[e],0)+a;n=true}}t+=a}return t};o.mp4aBox.prototype.getCodec=function(){var e=o.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI();var r=this.esds.esd.getAudioConfig();return e+"."+f(t)+(r?"."+r:"")}else{return e}};o.esdsBox.prototype.parse=function(e){this.parseFullHeader(e);this.data=e.readUint8Array(this.size);this.size=0;var t=new a;this.esd=t.parseOneDescriptor(new n(this.data.buffer,0,n.BIG_ENDIAN))};o.txtCBox.prototype.parse=function(e){this.parseFullHeader(e);this.config=e.readCString()};o.cttsBox.prototype.parse=function(e){var t;var r;this.parseFullHeader(e);t=e.readUint32();this.sample_counts=[];this.sample_offsets=[];if(this.version===0){for(r=0;rt&&this.flags&o.TFHD_FLAG_BASE_DATA_OFFSET){this.base_data_offset=e.readUint64();t+=8}else{this.base_data_offset=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DESC){this.default_sample_description_index=e.readUint32();t+=4}else{this.default_sample_description_index=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_DUR){this.default_sample_duration=e.readUint32();t+=4}else{this.default_sample_duration=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_SIZE){this.default_sample_size=e.readUint32();t+=4}else{this.default_sample_size=0}if(this.size>t&&this.flags&o.TFHD_FLAG_SAMPLE_FLAGS){this.default_sample_flags=e.readUint32();t+=4}else{this.default_sample_flags=0}};o.TRUN_FLAGS_DATA_OFFSET=1;o.TRUN_FLAGS_FIRST_FLAG=4;o.TRUN_FLAGS_DURATION=256;o.TRUN_FLAGS_SIZE=512;o.TRUN_FLAGS_FLAGS=1024;o.TRUN_FLAGS_CTS_OFFSET=2048;o.trunBox.prototype.parse=function(e){var t=0;this.parseFullHeader(e);this.sample_count=e.readUint32();t+=4;if(this.size>t&&this.flags&o.TRUN_FLAGS_DATA_OFFSET){this.data_offset=e.readInt32();t+=4}else{this.data_offset=0}if(this.size>t&&this.flags&o.TRUN_FLAGS_FIRST_FLAG){this.first_sample_flags=e.readUint32();t+=4}else{this.first_sample_flags=0}this.sample_duration=[];this.sample_size=[];this.sample_flags=[];this.sample_composition_time_offset=[];if(this.size>t){for(var r=0;r0){for(r=0;rn.MAX_SIZE){this.size+=8}s.d("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.position+(t||""));if(this.size>n.MAX_SIZE){e.writeUint32(1)}else{this.sizePosition=e.position;e.writeUint32(this.size)}e.writeString(this.type,null,4);if(this.size>n.MAX_SIZE){e.writeUint64(this.size)}};o.FullBox.prototype.writeHeader=function(e){this.size+=4;o.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags);e.writeUint8(this.version);e.writeUint24(this.flags)};o.Box.prototype.write=function(e){if(this.type==="mdat"){if(this.data){this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}}else{this.size=this.data.length;this.writeHeader(e);e.writeUint8Array(this.data)}};o.ContainerBox.prototype.write=function(e){this.size=0;this.writeHeader(e);for(var t=0;t>3}else{return null}};o.DecoderConfigDescriptor=function(e){o.Descriptor.call(this,t,e)};o.DecoderConfigDescriptor.prototype=new o.Descriptor;o.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8();this.streamType=e.readUint8();this.bufferSize=e.readUint24();this.maxBitrate=e.readUint32();this.avgBitrate=e.readUint32();this.size-=13;this.parseRemainingDescriptors(e)};o.DecoderSpecificInfo=function(e){o.Descriptor.call(this,r,e)};o.DecoderSpecificInfo.prototype=new o.Descriptor;o.SLConfigDescriptor=function(e){o.Descriptor.call(this,n,e)};o.SLConfigDescriptor.prototype=new o.Descriptor;return this};t.exports=n},{"./log":178}],177:[function(e,t,r){var i=e("./box");var n=e("./DataStream");var a=e("./log");var s=function(e){this.stream=e;this.boxes=[];this.mdats=[];this.moofs=[];this.isProgressive=false;this.lastMoofIndex=0;this.lastBoxStartPosition=0;this.parsingMdat=null;this.moovStartFound=false;this.samplesDataSize=0;this.nextParsePosition=0};t.exports=s;s.prototype.mergeNextBuffer=function(){var e;if(this.stream.bufferIndex+1"+this.stream.buffer.byteLength+")");return true}else{return false}}else{return false}};s.prototype.parse=function(){var e;var t;var r;a.d("ISOFile","Starting parsing with buffer #"+this.stream.bufferIndex+" (fileStart: "+this.stream.buffer.fileStart+" - Length: "+this.stream.buffer.byteLength+") from position "+this.lastBoxStartPosition+" ("+(this.stream.buffer.fileStart+this.lastBoxStartPosition)+" in the file)");this.stream.seek(this.lastBoxStartPosition);while(true){if(this.parsingMdat!==null){r=this.parsingMdat;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){a.d("ISOFile","Found 'mdat' end in buffer #"+this.stream.bufferIndex);this.parsingMdat=null;continue}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex);return}}else{this.lastBoxStartPosition=this.stream.position;t=i.parseOneBox(this.stream);if(t.code===i.ERR_NOT_ENOUGH_DATA){if(t.type==="mdat"){r=new i[t.type+"Box"](t.size-t.hdr_size);this.parsingMdat=r;this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+this.stream.position;r.hdr_size=t.hdr_size;this.stream.buffer.usedBytes+=t.hdr_size;e=this.reposition(false,r.fileStart+r.hdr_size+r.size);if(e){this.parsingMdat=null;continue}else{if(!this.moovStartFound){ -this.nextParsePosition=r.fileStart+r.size+r.hdr_size}else{this.nextParsePosition=this.findEndContiguousBuf(this.stream.bufferIndex)}return}}else{if(t.type==="moov"){this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}}else if(t.type==="free"){e=this.reposition(false,this.stream.buffer.fileStart+this.stream.position+t.size);if(e){continue}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size;return}}merged=this.mergeNextBuffer();if(merged){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength;continue}else{if(!t.type){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{if(this.moovStartFound){this.nextParsePosition=this.stream.buffer.fileStart+this.stream.buffer.byteLength}else{this.nextParsePosition=this.stream.buffer.fileStart+this.stream.position+t.size}}return}}}else{r=t.box;this.boxes.push(r);switch(r.type){case"mdat":this.mdats.push(r);r.fileStart=this.stream.buffer.fileStart+r.start;break;case"moof":this.moofs.push(r);break;case"moov":this.moovStartFound=true;if(this.mdats.length===0){this.isProgressive=true}default:if(this[r.type]!==undefined){a.w("ISOFile","Duplicate Box of type: "+r.type+", overriding previous occurrence")}this[r.type]=r;break}if(r.type==="mdat"){this.stream.buffer.usedBytes+=r.hdr_size}else{this.stream.buffer.usedBytes+=t.size}}}}};s.prototype.reposition=function(e,t){var r;r=this.findPosition(e,t);if(r!==-1){this.stream.buffer=this.stream.nextBuffers[r];this.stream.bufferIndex=r;this.stream.position=t-this.stream.buffer.fileStart;a.d("ISOFile","Repositioning parser at buffer position: "+this.stream.position);return true}else{return false}};s.prototype.findPosition=function(e,t){var r;var i=null;var n=-1;if(e===true){r=0}else{r=this.stream.bufferIndex}while(r=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.3",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server.js":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n=t){a.d("ISOFile","Found position in existing buffer #"+n);return n}else{return-1}}else{return-1}};s.prototype.findEndContiguousBuf=function(e){var t;var r;var i;r=this.stream.nextBuffers[e];if(this.stream.nextBuffers.length>e+1){for(t=e+1;t-1){this.moov.boxes.splice(r,1)}this.moov.mvex=null}this.moov.mvex=new i.mvexBox;this.moov.boxes.push(this.moov.mvex);this.moov.mvex.mehd=new i.mehdBox;this.moov.mvex.boxes.push(this.moov.mvex.mehd);this.moov.mvex.mehd.fragment_duration=this.initial_duration;for(t=0;t0?this.moov.traks[t].samples[0].duration:0;s.default_sample_size=0;s.default_sample_flags=1<<16}this.moov.write(e)};s.prototype.resetTables=function(){var e;var t,r,i,n,a,s,o,f;this.initial_duration=this.moov.mvhd.duration;this.moov.mvhd.duration=0;for(e=0;eg){y++;if(g<0){g=0}g+=o.sample_counts[y]}if(t>0){i.samples[t-1].duration=o.sample_deltas[y];k.dts=i.samples[t-1].dts+i.samples[t-1].duration}else{k.dts=0}if(f){if(t>_){b++;_+=f.sample_counts[b]}k.cts=i.samples[t].dts+f.sample_offsets[b]}else{k.cts=k.dts}if(u){if(t==u.sample_numbers[w]-1){k.is_rap=true;w++}else{k.is_rap=false}}else{k.is_rap=true}if(c){if(c.samples[subs_entry_index].sample_delta+last_subs_sample_index==t){k.subsamples=c.samples[subs_entry_index].subsamples;last_subs_sample_index+=c.samples[subs_entry_index].sample_delta}}}if(t>0)i.samples[t-1].duration=i.mdia.mdhd.duration-i.samples[t-1].dts}};s.prototype.updateSampleLists=function(){var e,t,r;var n,a,s,o;var f;var u,l,c,p,d;var h;while(this.lastMoofIndex0){h.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration}else{if(c.tfdt){h.dts=c.tfdt.baseMediaDecodeTime}else{h.dts=0}p.first_traf_merged=true}h.cts=h.dts;if(m.flags&i.TRUN_FLAGS_CTS_OFFSET){h.cts=h.dts+m.sample_composition_time_offset[r]}sample_flags=o;if(m.flags&i.TRUN_FLAGS_FLAGS){sample_flags=m.sample_flags[r]}else if(r===0&&m.flags&i.TRUN_FLAGS_FIRST_FLAG){sample_flags=m.first_sample_flags}h.is_rap=sample_flags>>16&1?false:true;var v=c.tfhd.flags&i.TFHD_FLAG_BASE_DATA_OFFSET?true:false;var g=c.tfhd.flags&i.TFHD_FLAG_DEFAULT_BASE_IS_MOOF?true:false;var y=m.flags&i.TRUN_FLAGS_DATA_OFFSET?true:false;var _=0;if(!v){if(!g){if(t===0){_=l.fileStart}else{_=f}}else{_=l.fileStart}}else{_=c.tfhd.base_data_offset}if(t===0&&r===0){if(y){h.offset=_+m.data_offset}else{h.offset=_}}else{h.offset=f}f=h.offset+h.size}}if(c.subs){var b=c.first_sample_index;for(t=0;t0){t+=","}t+=r.mdia.minf.stbl.stsd.entries[0].getCodec()}return t};s.prototype.getTrexById=function(e){var t;if(!this.originalMvex)return null;for(t=0;t=r.fileStart&&s.offset+s.alreadyRead=s){console.debug("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},i:function(t,r){if(n>=s){console.info("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",r)}},w:function(t,n){if(r>=s){console.warn("["+i.getDurationString(new Date-e,1e3)+"]","["+t+"]",n)}},e:function(r,n){if(t>=s){console.error("["+i.getDurationString(new Date-e,1e3)+"]","["+r+"]",n)}}};return o}();t.exports=i;i.getDurationString=function(e,t){function r(e,t){var r=""+e;var i=r.split(".");while(i[0].length0){var r="";for(var n=0;n0)r+=",";r+="["+i.getDurationString(e.start(n))+","+i.getDurationString(e.end(n))+"]"}return r}else{return"(empty)"}}},{}],179:[function(e,t,r){var n=e("./box");var a=e("./DataStream");var s=e("./isofile");var o=e("./log");var f=function(){this.inputStream=null;this.nextBuffers=[];this.inputIsoFile=null;this.onMoovStart=null;this.moovStartSent=false;this.onReady=null;this.readySent=false;this.onSegment=null;this.onSamples=null;this.onError=null;this.sampleListBuilt=false;this.fragmentedTracks=[];this.extractedTracks=[];this.isFragmentationStarted=false;this.nextMoofNumber=0};t.exports=f;f.prototype.setSegmentOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.fragmentedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.segmentStream=null;n.nb_samples=1e3;n.rapAlignement=true;if(r){if(r.nbSamples)n.nb_samples=r.nbSamples;if(r.rapAlignement)n.rapAlignement=r.rapAlignement}}};f.prototype.unsetSegmentOptions=function(e){var t=-1;for(var r=0;r-1){this.fragmentedTracks.splice(t,1)}};f.prototype.setExtractionOptions=function(e,t,r){var i=this.inputIsoFile.getTrackById(e);if(i){var n={};this.extractedTracks.push(n);n.id=e;n.user=t;n.trak=i;i.nextSample=0;n.nb_samples=1e3;n.samples=[];if(r){if(r.nbSamples)n.nb_samples=r.nbSamples}}};f.prototype.unsetExtractionOptions=function(e){var t=-1;for(var r=0;r-1){this.extractedTracks.splice(t,1)}};f.prototype.createSingleSampleMoof=function(e){var t=new n.moofBox;var r=new n.mfhdBox;r.sequence_number=this.nextMoofNumber;this.nextMoofNumber++;t.boxes.push(r);var i=new n.trafBox;t.boxes.push(i);var a=new n.tfhdBox;i.boxes.push(a);a.track_id=e.track_id;a.flags=n.TFHD_FLAG_DEFAULT_BASE_IS_MOOF;var s=new n.tfdtBox;i.boxes.push(s);s.baseMediaDecodeTime=e.dts;var o=new n.trunBox;i.boxes.push(o);t.trun=o;o.flags=n.TRUN_FLAGS_DATA_OFFSET|n.TRUN_FLAGS_DURATION|n.TRUN_FLAGS_SIZE|n.TRUN_FLAGS_FLAGS|n.TRUN_FLAGS_CTS_OFFSET;o.data_offset=0;o.first_sample_flags=0;o.sample_count=1;o.sample_duration=[];o.sample_duration[0]=e.duration;o.sample_size=[];o.sample_size[0]=e.size;o.sample_flags=[];o.sample_flags[0]=0;o.sample_composition_time_offset=[];o.sample_composition_time_offset[0]=e.cts-e.dts;return t};f.prototype.createFragment=function(e,t,r,i){var s=this.inputIsoFile.getTrackById(t);var f=this.inputIsoFile.getSample(s,r);if(f==null){if(this.nextSeekPosition){this.nextSeekPosition=Math.min(s.samples[r].offset,this.nextSeekPosition)}else{this.nextSeekPosition=s.samples[r].offset}return null}var u=i||new a;u.endianness=a.BIG_ENDIAN;var l=this.createSingleSampleMoof(f);l.write(u);l.trun.data_offset=l.size+8;o.d("BoxWriter","Adjusting data_offset with new value "+l.trun.data_offset);u.adjustUint32(l.trun.data_offset_position,l.trun.data_offset);var c=new n.mdatBox;c.data=f.data;c.write(u);return u};ArrayBuffer.concat=function(e,t){o.d("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var r=new Uint8Array(e.byteLength+t.byteLength);r.set(new Uint8Array(e),0);r.set(new Uint8Array(t),e.byteLength);return r.buffer};f.prototype.reduceBuffer=function(e,t,r){var i;i=new Uint8Array(r);i.set(new Uint8Array(e,t,r));i.buffer.fileStart=e.fileStart+t;i.buffer.usedBytes=0;return i.buffer};f.prototype.insertBuffer=function(e){var t=true;for(var r=0;ri.byteLength){this.nextBuffers.splice(r,1);r--;continue}else{o.w("MP4Box","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}}else{if(e.fileStart+e.byteLength<=i.fileStart){}else{e=this.reduceBuffer(e,0,i.fileStart-e.fileStart)}o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.splice(r,0,e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}t=false;break}else if(e.fileStart0){e=this.reduceBuffer(e,n,a)}else{t=false;break}}}if(t){o.d("MP4Box","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")");this.nextBuffers.push(e);if(r===0&&this.inputStream!==null){this.inputStream.buffer=e}}};f.prototype.processSamples=function(){var e;var t;if(this.isFragmentationStarted&&this.onSegment!==null){for(e=0;e=t.samples.length){o.i("MP4Box","Sending fragmented data on track #"+r.id+" for samples ["+(t.nextSample-r.nb_samples)+","+(t.nextSample-1)+"]");if(this.onSegment){this.onSegment(r.id,r.user,r.segmentStream.buffer,t.nextSample)}r.segmentStream=null;if(r!==this.fragmentedTracks[e]){break}}}}}if(this.onSamples!==null){for(e=0;e=t.samples.length){o.d("MP4Box","Sending samples on track #"+n.id+" for sample "+t.nextSample);if(this.onSamples){this.onSamples(n.id,n.user,n.samples)}n.samples=[];if(n!==this.extractedTracks[e]){break}}}}}};f.prototype.appendBuffer=function(e){var t;var r;if(e===null||e===undefined){throw"Buffer must be defined and non empty"}if(e.fileStart===undefined){throw"Buffer must have a fileStart property"}if(e.byteLength===0){o.w("MP4Box","Ignoring empty buffer (fileStart: "+e.fileStart+")");return}e.usedBytes=0;this.insertBuffer(e);if(!this.inputStream){if(this.nextBuffers.length>0){r=this.nextBuffers[0];if(r.fileStart===0){this.inputStream=new a(r,0,a.BIG_ENDIAN);this.inputStream.nextBuffers=this.nextBuffers;this.inputStream.bufferIndex=0}else{o.w("MP4Box","The first buffer should have a fileStart of 0");return}}else{o.w("MP4Box","No buffer to start parsing from");return}}if(!this.inputIsoFile){this.inputIsoFile=new s(this.inputStream)}this.inputIsoFile.parse();if(this.inputIsoFile.moovStartFound&&!this.moovStartSent){this.moovStartSent=true;if(this.onMoovStart)this.onMoovStart()}if(this.inputIsoFile.moov){if(!this.sampleListBuilt){this.inputIsoFile.buildSampleLists();this.sampleListBuilt=true}this.inputIsoFile.updateSampleLists();if(this.onReady&&!this.readySent){var i=this.getInfo();this.readySent=true;this.onReady(i)}this.processSamples();if(this.nextSeekPosition){t=this.nextSeekPosition;this.nextSeekPosition=undefined}else{t=this.inputIsoFile.nextParsePosition}var n=this.inputIsoFile.findPosition(true,t);if(n!==-1){t=this.inputIsoFile.findEndContiguousBuf(n)}o.i("MP4Box","Next buffer to fetch should have a fileStart position of "+t);return t}else{if(this.inputIsoFile!==null){return this.inputIsoFile.nextParsePosition}else{return 0}}};f.prototype.getInfo=function(){var e={};var t;var r;var n;var a=new Date(4,0,1,0,0,0,0).getTime();e.duration=this.inputIsoFile.moov.mvhd.duration;e.timescale=this.inputIsoFile.moov.mvhd.timescale;e.isFragmented=this.inputIsoFile.moov.mvex!=null;if(e.isFragmented&&this.inputIsoFile.moov.mvex.mehd){e.fragment_duration=this.inputIsoFile.moov.mvex.mehd.fragment_duration}else{e.fragment_duration=0}e.isProgressive=this.inputIsoFile.isProgressive;e.hasIOD=this.inputIsoFile.moov.iods!=null;e.brands=[];e.brands.push(this.inputIsoFile.ftyp.major_brand);e.brands=e.brands.concat(this.inputIsoFile.ftyp.compatible_brands);e.created=new Date(a+this.inputIsoFile.moov.mvhd.creation_time*1e3);e.modified=new Date(a+this.inputIsoFile.moov.mvhd.modification_time*1e3);e.tracks=[];e.audioTracks=[];e.videoTracks=[];e.subtitleTracks=[];e.metadataTracks=[];e.hintTracks=[];e.otherTracks=[];for(i=0;ie*n.timescale){f=r.samples[i-1].offset;l=i-1;break}if(t&&n.is_rap){a=n.offset;s=n.cts;u=i}}if(t){r.nextSample=u;o.i("MP4Box","Seeking to RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(s,c)+" and offset: "+a);return{offset:a,time:s/c}}else{r.nextSample=l;o.i("MP4Box","Seeking to non-RAP sample #"+r.nextSample+" on track "+r.tkhd.track_id+", time "+o.getDurationString(e)+" and offset: "+a);return{offset:f,time:e}}};f.prototype.seek=function(e,t){var r=this.inputIsoFile.moov;var i;var n;var a;var s={offset:Infinity,time:Infinity};if(!this.inputIsoFile.moov){throw"Cannot seek: moov not received!"}else{for(a=0;an){break}else if(o>=0||n<=l){o=l}}var c=o-n;if(c<0)c=0;i("Buffer length: %f",c);return c<=s}var h=new MediaSource;h.addEventListener("sourceopen",function(){w(0)});t.src=window.URL.createObjectURL(h);var m=new n;m.onError=function(e){i("MP4Box error: %s",e.message);if(b){b()}if(h.readyState==="open"){p("decode")}};var v=false;var g={};m.onReady=function(e){i("MP4 info: %o",e);e.tracks.forEach(function(e){var t;if(e.video){t="video/mp4"}else if(e.audio){t="audio/mp4"}else{return}t+='; codecs="'+e.codec+'"';if(MediaSource.isTypeSupported(t)){var r=h.addSourceBuffer(t);var i={buffer:r,arrayBuffers:[],meta:e,ended:false};r.addEventListener("updateend",A.bind(null,i));m.setSegmentOptions(e.id,null,{nbSamples:e.video?1:100});g[e.id]=i}});if(Object.keys(g).length===0){p("decode");return}var t=m.initializeSegmentation();t.forEach(function(e){S(g[e.id],e.buffer);if(e.id===f){o("init-track-"+f+".mp4",[e.buffer]);u.push(e.buffer)}});v=true};m.onSegment=function(e,t,r,i){var n=g[e];S(n,r,i===n.meta.nb_samples);if(e===f&&u){u.push(r);if(i>1e3){o("track-"+f+".mp4",u);u=null}}};var y;var _=null;var b=null;function w(t){if(t===e.length){m.flush();return}if(_&&t===y){var r=_;setTimeout(function(){if(_===r)_.resume()});return}if(_){_.destroy();b()}y=t;var n={start:y,end:e.length-1};_=e.createReadStream(n);function a(e){_.pause();var t=e.toArrayBuffer();t.fileStart=y;y+=t.byteLength;var r;try{r=m.appendBuffer(t)}catch(n){i("MP4Box threw exception: %s",n.message);if(h.readyState==="open"){p("decode")}_.destroy();b();return}w(r)}_.on("data",a);function s(){b();w(y)}_.on("end",s);function o(e){i("Stream error: %s",e.message);if(h.readyState==="open"){p("network")}}_.on("error",o);b=function(){_.removeListener("data",a);_.removeListener("end",s);_.removeListener("error",o);_=null;b=null}}function x(){if(v){k(t.currentTime)}}function k(e){if(c)l();var t=m.seek(e,true);i("Seeking to time: %d",e);i("Seeked file offset: %d",t.offset);w(t.offset)}function S(e,t,r){e.arrayBuffers.push({buffer:t,ended:r||false});A(e)}function E(){Object.keys(g).forEach(function(e){var t=g[e];if(t.blocked){A(t)}})}function A(e){if(e.buffer.updating)return;e.blocked=!d(e);if(e.blocked)return;if(e.arrayBuffers.length===0)return;var t=e.arrayBuffers.shift();var r=false;try{e.buffer.appendBuffer(t.buffer);e.ended=t.ended;r=true}catch(n){i("SourceBuffer error: %s",n.message);p("decode");return}if(r){U()}}function U(){if(h.readyState!=="open"){return}var e=Object.keys(g).every(function(e){var t=g[e];return t.ended&&!t.buffer.updating});if(e){p()}}};function o(e,t){var r=new Blob(t);var i=URL.createObjectURL(r);var n=document.createElement("a");n.setAttribute("href",i);n.setAttribute("download",e);n.click()}},{debug:121,mp4box:179}],181:[function(e,t,r){t.exports=i;function i(){var e={};for(var t=0;t0)return new Array(e+(/\./.test(t)?2:1)).join(r)+t;return t+""}},{}],184:[function(e,t,r){t.exports={name:"webtorrent",description:"Streaming torrent client",version:"0.62.3",author:{name:"Feross Aboukhadijeh",email:"feross@feross.org",url:"http://feross.org/"},bin:{webtorrent:"./bin/cmd.js"},browser:{"./lib/server.js":false,"bittorrent-dht/client":false,"fs-chunk-store":"memory-chunk-store","load-ip-set":false,ut_pex:false},bugs:{url:"https://github.com/feross/webtorrent/issues"},dependencies:{"addr-to-ip-port":"^1.0.1",bitfield:"^1.0.2","bittorrent-dht":"^3.0.0","bittorrent-swarm":"^5.0.0","chunk-store-stream":"^2.0.0",clivas:"^0.2.0","create-torrent":"^3.4.0","cross-spawn-async":"^2.0.0",debug:"^2.1.0","end-of-stream":"^1.0.0",executable:"^1.1.0","fs-chunk-store":"^1.3.4",hat:"0.0.3","immediate-chunk-store":"^1.0.7",inherits:"^2.0.1",inquirer:"^0.9.0","load-ip-set":"^1.0.3",mediasource:"^1.0.0","memory-chunk-store":"^1.2.0",mime:"^1.2.11",minimist:"^1.1.0",moment:"^2.8.3",multistream:"^2.0.2","network-address":"^1.0.0","parse-torrent":"^5.1.0","path-exists":"^1.0.0","pretty-bytes":"^2.0.1",pump:"^1.0.0","random-iterate":"^1.0.1","range-parser":"^1.0.2","re-emitter":"^1.0.0","run-parallel":"^1.0.0","simple-sha1":"^2.0.0",speedometer:"^0.1.2",thunky:"^0.1.0","torrent-discovery":"^3.0.0","torrent-piece":"^1.0.0",uniq:"^1.0.1",ut_metadata:"^2.1.0",ut_pex:"^1.0.1",videostream:"^1.1.4","windows-no-runnable":"0.0.6",xtend:"^4.0.0","zero-fill":"^2.2.0"},devDependencies:{"bittorrent-tracker":"^6.0.0",brfs:"^1.2.0",browserify:"^11.0.0",finalhandler:"^0.4.0","run-auto":"^1.0.0","serve-static":"^1.9.3","simple-get":"^1.0.0",standard:"^5.1.0",tape:"^4.0.0","uglify-js":"^2.4.15",zelda:"^2.0.0",zuul:"^3.0.0"},homepage:"http://webtorrent.io",keywords:["torrent","bittorrent","bittorrent client","streaming","download","webrtc","webrtc data","webtorrent","mad science"],license:"MIT",main:"index.js",optionalDependencies:{"airplay-js":"^0.2.3",chromecasts:"^1.5.3",nodebmc:"0.0.5"},repository:{type:"git",url:"git://github.com/feross/webtorrent.git"},scripts:{build:"browserify -s WebTorrent -e ./ | uglifyjs -m > webtorrent.min.js","build-debug":"browserify -s WebTorrent -e ./ > webtorrent.debug.js",size:"npm run build && cat webtorrent.min.js | gzip | wc -c",test:"standard && node ./bin/test.js","test-browser":"zuul -- test/basic.js","test-browser-local":"zuul --local -- test/basic.js","test-node":"tape test/*.js"}}},{}],185:[function(e,t,r){(function(r,i,n){t.exports=w;var a=e("create-torrent");var s=e("debug")("webtorrent");var o=e("bittorrent-dht/client");var f=e("events").EventEmitter;var u=e("xtend");var l=e("hat");var c=e("inherits");var p=e("load-ip-set");var d=e("run-parallel");var h=e("parse-torrent");var m=e("speedometer");var v=e("zero-fill");var g=e("path");var y=e("./lib/torrent");c(w,f);var _=e("./package.json").version;var b=_.match(/([0-9]+)/g).slice(0,2).map(v(2)).join("");function w(e){var t=this;if(!(t instanceof w))return new w(e);if(!e)e={};f.call(t);if(!s.enabled)t.setMaxListeners(0);t.destroyed=false;t.torrentPort=e.torrentPort||0;t.tracker=e.tracker!==undefined?e.tracker:true;t._rtcConfig=e.rtcConfig;t._wrtc=e.wrtc||i.WRTC;t.torrents=[];t.downloadSpeed=m();t.uploadSpeed=m();t.peerId=e.peerId===undefined?new n("-WW"+b+"-"+l(48),"utf8"):typeof e.peerId==="string"?new n(e.peerId,"hex"):e.peerId;t.peerIdHex=t.peerId.toString("hex");t.nodeId=e.nodeId===undefined?new n(l(160),"hex"):typeof e.nodeId==="string"?new n(e.nodeId,"hex"):e.nodeId;t.nodeIdHex=t.nodeId.toString("hex");if(e.dht!==false&&typeof o==="function"){t.dht=new o(u({nodeId:t.nodeId},e.dht));t.dht.listen(e.dhtPort)}s("new webtorrent (peerId %s, nodeId %s)",t.peerIdHex,t.nodeIdHex);if(typeof p==="function"){p(e.blocklist,{headers:{"user-agent":"WebTorrent/"+_+" (http://webtorrent.io)"}},function(e,r){if(e)return t.error("Failed to load blocklist: "+e.message);t.blocked=r;a()})}else r.nextTick(a);function a(){if(t.destroyed)return;t.ready=true;t.emit("ready")}}Object.defineProperty(w.prototype,"ratio",{get:function(){var e=this;var t=e.torrents.reduce(function(e,t){return e+t.uploaded},0);var r=e.torrents.reduce(function(e,t){return e+t.downloaded},0)||1;return t/r}});w.prototype.get=function(e){var t=this;if(e instanceof y)return e;var r;try{r=h(e)}catch(i){}if(!r)return null;if(!r.infoHash)throw new Error("Invalid torrent identifier");for(var n=0,a=t.torrents.length;n Date: Sat, 8 Aug 2015 21:51:36 -0700 Subject: [PATCH 105/109] Added test script for multiple file webseed. --- .../Leaves of Grass by Walt Whitman.epub | Bin 0 -> 362017 bytes test/content/multiple/blocklist.txt | 2 + test/content/multiple/blocklist.txt.gz | Bin 0 -> 91 bytes test/content/multiple/folder/file.txt | 1 + test/content/multiple/numbers/1.txt | 1 + test/content/multiple/numbers/2.txt | 1 + test/content/multiple/numbers/3.txt | 1 + ...download-webseed-multiple-files-torrent.js | 67 ++++++++++++++++++ test/torrents/multiple.torrent | Bin 0 -> 678 bytes 9 files changed, 73 insertions(+) create mode 100644 test/content/multiple/Leaves of Grass by Walt Whitman.epub create mode 100644 test/content/multiple/blocklist.txt create mode 100644 test/content/multiple/blocklist.txt.gz create mode 100644 test/content/multiple/folder/file.txt create mode 100644 test/content/multiple/numbers/1.txt create mode 100644 test/content/multiple/numbers/2.txt create mode 100644 test/content/multiple/numbers/3.txt create mode 100644 test/download-webseed-multiple-files-torrent.js create mode 100644 test/torrents/multiple.torrent diff --git a/test/content/multiple/Leaves of Grass by Walt Whitman.epub b/test/content/multiple/Leaves of Grass by Walt Whitman.epub new file mode 100644 index 0000000000000000000000000000000000000000..66791ed3b0d9aaf29fc687d803c43a74c1372e8c GIT binary patch literal 362017 zcmb@sV{oQT)GZuqV%xTp2_|=Jb7I@J?MyteZQHh;+_7z+c}|^ks^0JS*VU`Lx~|&Y z)oWdQ*RI;FAPo+I4)R|^R<;qcGpL~dZ}lHw{=vq=#>Cmf-o(J(-rB;*z}dpimdV84 z#gNX^!d~J3Si<~o%SI^};);J3@Be`L53-^vf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N~PCv5ERpiRdggLGXnFr>sW ze=8}i{$GOf{tWKHddv7P zL52PZdWb9i>?J@BdjJo={0~Or%=t@DoYrI@YJa*m0;plF!rxKp%KsMi z&$QI4poqi)2J8F!-%-hS{}%PnyhJ?k!-wfP21XmeOaIx2J^66{vR(g7O!qfV8Et?X z2Iv2ditq5ZsDEarwbn0EuYs%0Qu^m?|-*ket*R3e^Ggr{*C(Y2d;jX{N4BcU&#@te@p%!p0JX_ VE!=-n&;fsvw*jNY?H2Iu{{ue{TY>-p literal 0 HcmV?d00001 diff --git a/test/content/multiple/blocklist.txt b/test/content/multiple/blocklist.txt new file mode 100644 index 00000000..167627df --- /dev/null +++ b/test/content/multiple/blocklist.txt @@ -0,0 +1,2 @@ +Blah blah description:1.2.3.0-1.2.3.255 +Blah blah different description:5.6.7.0-5.6.7.255 diff --git a/test/content/multiple/blocklist.txt.gz b/test/content/multiple/blocklist.txt.gz new file mode 100644 index 0000000000000000000000000000000000000000..5f401edcb60c1039af5f02660f0cbc2a0acc0b92 GIT binary patch literal 91 zcmV-h0HpsPiwFpSi>Oop17d7%V{2?_b963rcys`B%1O*nNCFWlsl~}fnFS@8`FU1` xdPaK2dIq`>+Q`(D%L$<_Gc7H(C^fGHMTe=LnVvaN2ZRRc007YA@kLqy003;~BtHNE literal 0 HcmV?d00001 diff --git a/test/content/multiple/folder/file.txt b/test/content/multiple/folder/file.txt new file mode 100644 index 00000000..0637880d --- /dev/null +++ b/test/content/multiple/folder/file.txt @@ -0,0 +1 @@ +This is a file diff --git a/test/content/multiple/numbers/1.txt b/test/content/multiple/numbers/1.txt new file mode 100644 index 00000000..56a6051c --- /dev/null +++ b/test/content/multiple/numbers/1.txt @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/test/content/multiple/numbers/2.txt b/test/content/multiple/numbers/2.txt new file mode 100644 index 00000000..8fdd954d --- /dev/null +++ b/test/content/multiple/numbers/2.txt @@ -0,0 +1 @@ +22 \ No newline at end of file diff --git a/test/content/multiple/numbers/3.txt b/test/content/multiple/numbers/3.txt new file mode 100644 index 00000000..4f376707 --- /dev/null +++ b/test/content/multiple/numbers/3.txt @@ -0,0 +1 @@ +333 \ No newline at end of file diff --git a/test/download-webseed-multiple-files-torrent.js b/test/download-webseed-multiple-files-torrent.js new file mode 100644 index 00000000..aeb499a6 --- /dev/null +++ b/test/download-webseed-multiple-files-torrent.js @@ -0,0 +1,67 @@ +var auto = require('run-auto') +var fs = require('fs') +var parseTorrent = require('parse-torrent') +var test = require('tape') +var WebTorrent = require('../') + +var http = require('http') +var serveStatic = require('serve-static') +var finalhandler = require('finalhandler') +var path = require('path') +var multipleFileTorrent = fs.readFileSync(__dirname + '/torrents/multiple.torrent') +var multipleFileTorrentParsed = parseTorrent(multipleFileTorrent) + +// remove trackers from .torrent file +multipleFileTorrentParsed.announce = [] + +test('Download multiple files using webseed (via .torrent file)', function (t) { + t.plan(18) + + var serve = serveStatic(path.join(__dirname, 'content')) + var httpServer = http.createServer(function (req, res) { + var done = finalhandler(req, res) + serve(req, res, done) + }) + + httpServer.on('error', function (err) { t.fail(err) }) + + auto({ + httpPort: function (cb) { + httpServer.listen(cb) + }, + client: ['httpPort', function (cb) { + multipleFileTorrentParsed.urlList.push( + 'http://localhost:' + httpServer.address().port + '/' + ) + + var client = new WebTorrent({ tracker: false, dht: false }) + + client.on('error', function (err) { t.fail(err) }) + client.on('warning', function (err) { t.fail(err) }) + + client.on('torrent', function (torrent) { + torrent.files.forEach(function (file) { + file.getBuffer(function (err, buf) { + t.error(err) + t.deepEqual(buf, fs.readFileSync(__dirname + '/content/' + file.path), 'downloaded correct content') + }) + }) + + torrent.once('done', function () { + t.pass('client downloaded torrent from webseed') + cb(null, client) + }) + }) + + client.add(multipleFileTorrentParsed) + }] + }, function (err, r) { + t.error(err) + r.client.destroy(function () { + t.pass('client destroyed') + }) + httpServer.close(function () { + t.pass('http server closed') + }) + }) +}) diff --git a/test/torrents/multiple.torrent b/test/torrents/multiple.torrent new file mode 100644 index 0000000000000000000000000000000000000000..e73e40d3e0adcf63836b266704eb07c34dc84e2b GIT binary patch literal 678 zcmYc>G_Xo8N=+ zs!A`t3R$6{DNLc6RT|i57GO7{8wfYg+$yg$Hz~EK*wo4pU6B#YEF?un=!%T7C^Cj9 z0?Oni=B8R$<(B4@WESM48X8#@WTqykD!@X|$lS~#)eIt7Y-D0!)tjI0F-Ip(bJOKX zNeod5uPdiFR6g|U>xvZmd%-YPFeJitr~0Jrk1HlH`aHgV>*K4I7P-6?<^2~9{`b6* z=~Lq^ZSyQEQDohXj}!iEaj9!rc&uBZb=G^s)|0~W3Y>3}{X#` Date: Sun, 9 Aug 2015 08:56:49 -0700 Subject: [PATCH 106/109] fixed test script for multiple files torrent. --- test/download-webseed-multiple-files-torrent.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/download-webseed-multiple-files-torrent.js b/test/download-webseed-multiple-files-torrent.js index aeb499a6..9e945789 100644 --- a/test/download-webseed-multiple-files-torrent.js +++ b/test/download-webseed-multiple-files-torrent.js @@ -15,7 +15,7 @@ var multipleFileTorrentParsed = parseTorrent(multipleFileTorrent) multipleFileTorrentParsed.announce = [] test('Download multiple files using webseed (via .torrent file)', function (t) { - t.plan(18) + t.plan(19) var serve = serveStatic(path.join(__dirname, 'content')) var httpServer = http.createServer(function (req, res) { @@ -39,17 +39,21 @@ test('Download multiple files using webseed (via .torrent file)', function (t) { client.on('error', function (err) { t.fail(err) }) client.on('warning', function (err) { t.fail(err) }) + var count = 0 client.on('torrent', function (torrent) { torrent.files.forEach(function (file) { file.getBuffer(function (err, buf) { t.error(err) t.deepEqual(buf, fs.readFileSync(__dirname + '/content/' + file.path), 'downloaded correct content') + if (++count === 7) { + t.pass('7 files downloaded from webseed') + cb(null, client) + } }) }) torrent.once('done', function () { t.pass('client downloaded torrent from webseed') - cb(null, client) }) }) From 5ea51ec13933afbf64ca3dabd9716fc73a30ecc5 Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Sun, 9 Aug 2015 08:57:23 -0700 Subject: [PATCH 107/109] added webseed multiple files for magnet. --- .../download-webseed-multiple-files-magnet.js | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 test/download-webseed-multiple-files-magnet.js diff --git a/test/download-webseed-multiple-files-magnet.js b/test/download-webseed-multiple-files-magnet.js new file mode 100644 index 00000000..0fcb1e58 --- /dev/null +++ b/test/download-webseed-multiple-files-magnet.js @@ -0,0 +1,121 @@ +var auto = require('run-auto') +var finalhandler = require('finalhandler') +var fs = require('fs') +var http = require('http') +var parseTorrent = require('parse-torrent') +var path = require('path') +var serveStatic = require('serve-static') +var test = require('tape') +var WebTorrent = require('../') + +var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' +var leavesFilename = 'Leaves of Grass by Walt Whitman.epub' +var leavesFile = fs.readFileSync(leavesPath) + +var multipleFileTorrent = fs.readFileSync(__dirname + '/torrents/multiple.torrent') +var multipleFileTorrentParsed = parseTorrent(multipleFileTorrent) + +// remove trackers from .torrent file +multipleFileTorrentParsed.announce = [] +test('Download using multiple files webseed (via magnet uri)', function (t) { + t.plan(22) + + var serve = serveStatic(path.join(__dirname, 'content')) + var httpServer = http.createServer(function (req, res) { + var done = finalhandler(req, res) + serve(req, res, done) + }) + var magnetUri + + httpServer.on('error', function (err) { t.fail(err) }) + + auto({ + httpPort: function (cb) { + httpServer.listen(cb) + }, + client1: ['httpPort', function (cb) { + var client1 = new WebTorrent({ tracker: false, dht: false }) + client1.on('error', function (err) { t.fail(err) }) + client1.on('warning', function (err) { t.fail(err) }) + + client1.add(multipleFileTorrentParsed) + + var gotTorrent = false + var gotListening = false + function maybeDone () { + if (gotTorrent && gotListening) cb(null, client1) + } + + client1.on('torrent', function (torrent) { + // torrent metadata has been fetched -- sanity check it + t.equal(torrent.name, 'multiple') + + var names = [ + 'Leaves of Grass by Walt Whitman.epub', + 'blocklist.txt', + 'blocklist.txt.gz', + 'file.txt', + '1.txt', + '2.txt', + '3.txt' + ] + + t.deepEqual(torrent.files.map(function (file) { return file.name }), names) + + // NOTE: client1 is *NOT* a seeder. Just has the metadata. + gotTorrent = true + maybeDone() + }) + + client1.on('listening', function () { + gotListening = true + maybeDone() + }) + }], + client2: ['client1', 'httpPort', function (cb, r) { + var webSeedUrl = 'http://localhost:' + httpServer.address().port + '/' + magnetUri = 'magnet:?xt=urn:btih:' + multipleFileTorrentParsed.infoHash + + '&ws=' + encodeURIComponent(webSeedUrl) + + var client2 = new WebTorrent({ tracker: false, dht: false }) + + client2.on('error', function (err) { t.fail(err) }) + client2.on('warning', function (err) { t.fail(err) }) + + client2.on('torrent', function (torrent) { + var count = 0 + torrent.files.forEach(function (file) { + file.getBuffer(function (err, buf) { + t.error(err) + t.deepEqual(buf, fs.readFileSync(__dirname + '/content/' + file.path), 'downloaded correct content') + if (++count === 7) { + t.pass('7 files downloaded from webseed') + cb(null, client2) + } + }) + }) + + torrent.once('done', function () { + t.pass('client2 downloaded torrent from client1') + }) + }) + + client2.add(magnetUri) + + client2.on('listening', function (port, torrent) { + torrent.addPeer('127.0.0.1:' + r.client1.torrentPort) + }) + }] + }, function (err, r) { + t.error(err) + r.client1.destroy(function () { + t.pass('client destroyed') + }) + r.client2.destroy(function () { + t.pass('client destroyed') + }) + httpServer.close(function () { + t.pass('http server closed') + }) + }) +}) From c331a4bc9f961991729e1886a5ff77f03eaf3beb Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Sun, 9 Aug 2015 09:00:15 -0700 Subject: [PATCH 108/109] style --- test/download-webseed-multiple-files-magnet.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/download-webseed-multiple-files-magnet.js b/test/download-webseed-multiple-files-magnet.js index 0fcb1e58..ef37c2d7 100644 --- a/test/download-webseed-multiple-files-magnet.js +++ b/test/download-webseed-multiple-files-magnet.js @@ -8,10 +8,6 @@ var serveStatic = require('serve-static') var test = require('tape') var WebTorrent = require('../') -var leavesPath = __dirname + '/content/Leaves of Grass by Walt Whitman.epub' -var leavesFilename = 'Leaves of Grass by Walt Whitman.epub' -var leavesFile = fs.readFileSync(leavesPath) - var multipleFileTorrent = fs.readFileSync(__dirname + '/torrents/multiple.torrent') var multipleFileTorrentParsed = parseTorrent(multipleFileTorrent) From 463780d64f3793e3eadb34b80c753b85ddc5930b Mon Sep 17 00:00:00 2001 From: Simba Zhang Date: Mon, 26 Oct 2015 17:36:36 -0700 Subject: [PATCH 109/109] Switch to work repo to test multiple file download in webseed. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index db770bc8..14dc6cbd 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "addr-to-ip-port": "^1.0.1", "bitfield": "^1.0.2", "bittorrent-dht": "^3.0.0", - "bittorrent-swarm": "^5.0.0", "chunk-store-stream": "^2.0.0", + "bittorrent-swarm": "https://github.com/solderzzc/bittorrent-swarm.git", "clivas": "^0.2.0", "create-torrent": "^3.4.0", "cross-spawn-async": "^2.0.0",